|
Can you use a Fiddler to see how much data is flowing for the request on check of the postback? And based on this, what is the weight per object in the data.
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
The woods are lovely, dark and deep,
But I have promises to keep,
And miles to go before I sleep,
And miles to go before I sleep!
|
|
|
|
|
I am supposed to create an data transfer utility that is to take data from an external source. in this case it's another database, and import/update data into an asp.net website database.
Now, the database and the site were created by another party and they already have an API/framework to access the database.
I've tried to write code on the site that imports the data but it sometimes times out and the app pool recycles.
How do I run a data transfer without timeouts and using the third part API so I don't have to re-write a ton of code?
|
|
|
|
|
Probably not enough information to answer your question.
1) Explain how you have tried your export/import.
Ex: Run a query, collect the data, save it to a text file.
Run a program which calls the API to import the data line by line.
etc.
2) Do you have local access to both databases?
3) What is the nature of the API ? Is this a webservice? Are your sure you are using the API as recommended by the vendor? I have a vendor supplied API which uses tons of memory if I try to load data with it. I had to break my program into chunks so that their library could free up memory in between my data load sessions. This makes me believe that they are doing some sloppy memory management (not disposing of objects)
4) You might want to check with the vendor about the proper use of their API.
5) Maybe post a code snipet here.
The folks here will try to give you an answer, but I think more details are needed.
Good luck. 
|
|
|
|
|
<Columns>
<asp:TemplateField HeaderText="Name">
<ItemTemplate>
<asp:Label Text='<%#Eval("Name") %>' runat="server"></asp:Label>
</ItemTemplate>
</asp:TemplateField>
|
|
|
|
|
|
I have a web page with a method called to display some images in the DataList control
MyImage.cs
class MyImage
{
string Name { get; set; }
byte[] Jpeg { get; set; }
}
MyImages.aspx.cs
pubic void DisplayMyImages(IEnumerable myImages)
{
this.myImagesDataList.DataSource = myImages;
this.myImagesDataList.DataBind();
}
...
protected void myImagesDataList_ItemDataBound(object sender, DataListItemEventArgs e)
{
if (e.Item.ItemType == ListItemType.Item ||
e.Item.ItemType == ListItemType.AlternatingItem)
{
MyImage myImage = (MyImage)e.Item.DataItem;
Image myImageImage = (Image)e.Item.FindControl("myImageImage");
myImageImage.ImageUrl = "~/Handlers/ImageHandler.ashx";
}
}
But how to pass jpeg image to ImageHandler if it is already extracted from the database and passed to DisplayMyImages() function?
Remarks:
I do not want to save them back to files and pass the paths in a query string to ImageHandler
Having a standard query string approach is not possible as I do not want to violate model view presenter approach
Чесноков
|
|
|
|
|
Depending on how big your images are, and which browsers you need to support, you might be able to use a data URI[^].
(If you're using IE8, you're limited to 32Kb; earlier versions of IE aren't supported at all.)
myImageImage.ImageUrl = "data:image/jpeg;base64," + Convert.ToBase64String(myImage.Jpeg);
If you need to support older versions of IE, you'll need to pass a query-string to your handler. If the image is more than 32Kb, it'll be too large for a query-string, so you'll need to pass some kind of ID to allow the handler to retrieve the image.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
that is interesting approach! never thought of it before
Чесноков
modified 22-Oct-12 13:27pm.
|
|
|
|
|
hello,
Can anybody help me to insert,delete,update in datagridview in asp.net without any postback. or with webservice.
|
|
|
|
|
|
Can anybody describe the whole coding to creating a new session and sending values on next page by using sessions
|
|
|
|
|
|
Just write
session["id"]="1234";
For Retrieving on any page
TextBox1.Text=(string)session["id"];
Casting depends upon type of variable you are using
|
|
|
|
|
|
|
Hi..Hope it helps u
String Mymsg = String.Format("110", authCode, DateTime.Now.ToString(), txtFirstName.Text + " " + txtLastName.Text, txtPayment.Text);
Session["Successmsg"] = Mymsg;
Response.Redirect("Thank.aspx");
In Thank.aspx.cs page:
Label2.Text = (String)(Session["Successmsg"]);
Session.Abandon();
Session.Clear();
|
|
|
|
|
Hi,
i wanna to call the bellow function while the Textbox1 got focus (when user click on Textbox1 OR when user press tab and textbox1 got focus):
<head runat="server">
<title>Untitled Page</title>
<script type="text/javascript">
function Open() {
var Return;
var myObject = new Object();
myObject.TextBox1 = document.getElementById("txtFirstName").value;
if (window.showModalDialog) {
Return = window.showModalDialog("childform.aspx", myObject, "dialogWidth:670px;dialogHeight:600px;")
document.getElementById("txtFirstName").value = Return.firstname;
}
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
</div>
</form>
</body>
|
|
|
|
|
Instead of reposting your question, use the Edit link to update it.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
you should call
$('#txtFirstName').focus(funcation(){
// type code here ...
});
----- OR ------
funcation myfuncation(){
// type code here ...
}
set this funcation in onBlur() event.
|
|
|
|
|
Hi,
i wanna to call the bellow function while the Textbox1 got focus (when user click on Textbox1 OR when user press tab and textbox1 got focus):
<title>Untitled Page
function Open() {
var Return;
var myObject = new Object();
myObject.TextBox1 = document.getElementById("txtFirstName").value;
if (window.showModalDialog) {
Return = window.showModalDialog("childform.aspx", myObject, "dialogWidth:670px;dialogHeight:600px;")
document.getElementById("txtFirstName").value = Return.firstname;
}
}
|
|
|
|
|
Write this in your code behind file:
myTextBox.Attributes.Add("onfocus","javascript: Open();");
This will add the onfocus client side event to your textbox.
|
|
|
|
|
In order to call the JavaScript function, Just use the Following:
protected void Page_Load(object sender, EventArgs e)
{
TextBox1.Attributes.Add("onfocus", "Open()");
}
This will bind the "onfocus" event of TextBox1 to the javascript function "Open()"
|
|
|
|
|
But unlike others i believe you should handle it from your client and not ASP.net.
You should implement it as follow:
document.getElementById("<%= TextBox1.ClientID %>").onfocus=function(){Open();}
|
|
|
|
|
I am a total noob to ASP, so I hope you can bear with me while I get the stupid questions out of the way.
I have an .ASP registration popup form on my webpage that is being attacked by bots. They can't get in because each user must be activated on the server side first, but they are starting to get annoying due to the number of false registrations I have to delete.
I know there is CAPCHA code available, but I want to make it very simple for my customers when they register so I was wondering if I could just add a yes/no type question to my "If/then/else function", for example "is the sky blue", or "are you from Mars", "are you a human", etc. then have a field that has to be filled in with the correct answer, have the answer checked by the statement and if it is incorrect the form is closed or cleared, if it is correct the form stays active and they can submit it.
I don't like the random word images with all the scribbles, some of them are too long or are hard to read, and I'm not very good at coding ASP yet that I could find the right place to put all that code. Also, a humanizer question can be changed at any time very quickly by me if any bot figured it out - IF it would work.
Thanks for any help.
modified 21-Oct-12 19:02pm.
|
|
|
|
|
Use the person's email address as their username for your site is probably the easist.
Once they fill out a basic registration page your website should generate a validation email back to them with some hash code they need to respond with on a secondary validation page.
You create their user account on your server with an expiration date of 48 hours from the time they created their initial account.
You can create logic to kill any accounts that have not been validated and are past their 48 hour expiration window.
Something like that.

|
|
|
|