|
no your fine.
I'm still trying to understand the question. My rephrase was the only thing that made any sense.
It's like one of those detective shows, and you have to figure out the crime based on the written statement of the OP.
|
|
|
|
|
You are correct. This is what I am trying to say:
There has a form with a checkbox in a tall panel with scrollbars set to auto. The user clicks on the checkbox, and it alters the form, and during the parital or whole page postback, the panel scroll position defaults back to the top.
How do I reset the scroll position to where the user left it, during a partial or whole page postback.
|
|
|
|
|
|
Yah
I think I just posted the same link
Good job!
|
|
|
|
|
Thats too funny. Looks like you covered it a little better than I did though so good job to you!
|
|
|
|
|
Thanks,
I figured the question was wrong, and the OP had no clue what was happening there.
Well, hopefully, he learned something there today.
These asp.net questions are getting harder to answer because the way the questions are phrased make no sense to me.
One day, someone will ask a really good question
Over and out, time to sleep
|
|
|
|
|
Aw, The page lifecycle
OnInit, Intialize the html elements on the page
onLoad, load values for the html elements
once the page does onInit, the html elements are cast in stone, and will not change
Once the page does onLoad, you can populate values in the html elements
During a postback to the server, the html elements are rock solid, and the values will remain, but things like scroll position reset back to default. The page does not have the ability to remember little details like scroll position
MaintainScrollPosition is for the scroll of the whole page, and not a panel.
But, maybe, instead of page.MaintainScrollPosiiton, you could do panelName.MaintainScrollPosition
Other that that, you would have to take a measurement of the position, record it, and restore it back to the value, in theory
I don't have an answer, I would have to think about it and experiment.
A quick search gets this document.getElementById('box').scrollTop
Persisting the scroll position of a DIV on AJAX postbacks [^]
Maintain Scroll Position in Panel, Div[^]
http://michaelsync.net/2006/06/30/maintain-scroll-position-of-div-using-javascript-aspnet-20[^]
http://forums.asp.net/t/1359867.aspx[^]
|
|
|
|
|
dcof wrote: There is no postback involved most of the time.
dcof wrote: There is no postback.The user does not want the scrollbar to go to the top area of the scroll. T
Well, not possible! Without a postback, page would not return scroll to top by itself!
My answer still holds. Try out. Both the options. For second one, use form onsubmit() event to store the scroll position and then restore it on form load.
|
|
|
|
|
Use Smartnavigation = true property hope it will suits your requirement.
|
|
|
|
|
Oh yes, I totally forgot about it!
|
|
|
|
|
You probably forgot because your first suggestion is the replacement for the deprecated property.
[BrowsableAttribute(false)]
[ObsoleteAttribute("The recommended alternative is Page.SetFocus and Page.MaintainScrollPositionOnPostBack. http://go.microsoft.com/fwlink/?linkid=14202")]
public bool SmartNavigation { get; set; }
http://msdn.microsoft.com/en-us/library/system.web.ui.page.smartnavigation.aspx[^]
|
|
|
|
|
5!
Thanks for bringing back some part of memory.
|
|
|
|
|
How we can find html radio button id in asp.net in side datalist control.
....................
Thanks
|
|
|
|
|
Even though the person who asked this in Q&A has different user id, he had same question that I replied here: access to html radio button that created dynamically[^]
You cannot write anything here to access them. You made a HTML control and not server control. HTML controls cannot be accessed on server side codebase.
|
|
|
|
|
I am using this code to save file to MySQL but when I try to open the file after saving it I get an error saying:
Word was unable to read this document. It may be corrupt.
here is the code to write:
file_name = Path.GetFileName(uploadResume.PostedFile.FileName);
file_extension = Path.GetExtension(uploadResume.PostedFile.FileName);
switch (file_extension)
{
case ".pdf": document_type = "application/pdf"; break;
case ".doc": document_type = "application/vnd.ms-word"; break;
case ".docx": document_type = "application/vnd.ms-word"; break;
case ".gif": document_type = "image/gif"; break;
case ".png": document_type = "image/png"; break;
case ".jpg": document_type = "image/jpg"; break;
case ".jpeg": document_type = "image/jpg"; break;
}
int file_size = uploadResume.PostedFile.ContentLength;
byte[] document_binary = new byte[file_size];
uploadResume.PostedFile.InputStream.Read(document_binary, 0, file_size);
and then passing it as parameters:
sql_command.Parameters.AddWithValue("param_resume_format", document_type).MySqlDbType = MySqlDbType.VarChar;
sql_command.Parameters.Add("param_resume_data", MySqlDbType.Blob, file_size).Value = document_binary;
and here is how I am retrieving it:
sql_connection = new MySqlConnection(ConfigurationManager.ConnectionStrings["SQLdb"].ConnectionString);
sql_connection.Open();
sql_command = new MySqlCommand("sp_get_resume_by_id", sql_connection);
sql_command.CommandType = CommandType.StoredProcedure;
sql_command.Parameters.Add("param_resume_id", MySqlDbType.Int32).Value = resume_id;
sql_reader = sql_command.ExecuteReader();
sql_reader.Read();
if (sql_reader.HasRows)
{
file_name = sql_reader["resume_id"].ToString() + sql_reader["resume_ext"].ToString();
byte[] document_binary = (byte[])sql_reader["resume_data"];
FileStream file_stream = new FileStream(@"C:\Temp\" + file_name, FileMode.Create);
file_stream.Write(document_binary, 0, document_binary.Length);
file_stream.Close();
file_stream.Dispose();
txtResume.Visible = true;
}
|
|
|
|
|
In a BLOB, you can store a maximum of 65535 bytes. Check that your file did not get truncated; if necessary, change the field type to MEDIUMBLOB or even LONGBLOB.
|
|
|
|
|
changed to longblob in the code (the parameter) and the MySQL field data type but still getting the same error. Here is the exact error I am getting when I am trying to open the downloaded word file.
This error message can appear if the document you are attempting to open is corrupt. It is possible to recover a corrupt file or its content by using either the Recover Text converter (may require installation) or the Open and Repair feature.
The Open and Repair feature is available from the Open dialog. To open and attempt a repair, click the File tab, click Open, and then navigate to the damaged file and click it once. Instead of clicking the Open button at the bottom right of the dialog box, click the down arrow to the right of the button and select Open and Repair from the menu. If the file can be recovered, it will open and appear in the document work area.
The Recover Text converter, if installed, is available from the Open dialog and appears in the Files of type drop down list. It appears in the drop-down list as Recover Text from Any File (*.*).
For more information, see Microsoft Knowledge Base article 918429.
|
|
|
|
|
|
vishnukamath wrote: Please suggest me better way.
What's the problem with the article suggested way?
Simple logic: Have multiple XMLHttpRequests on load of page (equal to number of user controls - each mapped to one area on page to be shown in a panel). Each request will get the HTML of a defined panel. Once the response is received, show the panel with HTML returned.
|
|
|
|
|
vishnukamath wrote: can we load user controls one by one
You really can't load each control one by one, unless you made separate calls to the server and asked for each control 1 at a time.
All you can do is create a container to hold your dynamic controls, and update the container in either a single request to the server, or multiple requests to the server.
vishnukamath wrote: with loading image
In either case, javascript is required to alter the elements in the DOM, and when Javascript makes a change to the DOM, it rams the script through with complete disregard to any order or timing you wish to achieve, unless you add painting events to the script.
vishnukamath wrote: we have found below link for asynchronous loading.Please suggest me better way.
I inspected the link you provided, and it looks like a good solution. I don't see the problem with trying it out, unless the article was too complicated for you and your looking for something easier.
The only better way I can think of is the way Code Project does it. But if you have to ask how to do it, then I think ....
|
|
|
|
|
How do I handle wrongly suffixed url of webpages?
for eg:
Correct url:
http://mdc01c/en/Journey/
Played with url:
http://mdc01c/en/Journey/df
how to handle 'Played with url' case in ASP.Net?
Please guide. Thanks.
// ♫ 99 little bugs in the code,
// 99 bugs in the code
// We fix a bug, compile it again
// 101 little bugs in the code ♫
|
Tell your manager, while you code: "good, cheap or fast: pick two. "
|
|
|
|
|
Ravi Sant wrote: how to handle 'Played with url' case in ASP.Net?
Display a 404-page?
What else would you want to do? You could log the IP from the requestor, and block them for a certain period if you're under the impression that they're looking for holes in your security.
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
I am sorry, if have wrongly or partially framed question.
I have already done that using customerrors=on in asp.net web.config.
But, it does not works for internal websites and I am to no-where since yesterday.
// ♫ 99 little bugs in the code,
// 99 bugs in the code
// We fix a bug, compile it again
// 101 little bugs in the code ♫
|
Tell your manager, while you code: "good, cheap or fast: pick two. "
|
|
|
|
|
you can do it by window.location = newUrl;
|
|
|
|
|
Hi,
I have a database structure similar to the following schema that holds survey information for different types of surveys:
http://www.databaseanswers.org/data_models/questionnaires_for_marketing_surveys/index.htm
I've created the surveys and the question that should appear on the survey from within the database. Currently I have 3 surveys each with different questions. How would I go about querying the database to create a html form with text boxes and radio buttons on the fly based on the what questions should appear on the survey form?
The hardway is to custom build the html forms with fields that map to the questions in the database. However this can become tedious when everytime a new survey form needs creating with different questions.
Basically am looking for some code example that will help me get started off to dynamically generate a html survey form based on the information stored in the database. I'm sure somebody must have done something similar before.
Any help will be much appreciated.
|
|
|
|