stop page reloading in asp.net
-
hi sir, i am new in asp.net.sir i want to know that is there any java script with the help of which we can stop page reloading at the time of using ajax control.and dropdown text selection. sir i know that update panel can do this.but sir i do not want to use update panel.i mean i want to stop my page reload without using update panel while i am using ajax. please help me sir i am posting my this question again. because first time i did not get any response.
-
hi sir, i am new in asp.net.sir i want to know that is there any java script with the help of which we can stop page reloading at the time of using ajax control.and dropdown text selection. sir i know that update panel can do this.but sir i do not want to use update panel.i mean i want to stop my page reload without using update panel while i am using ajax. please help me sir i am posting my this question again. because first time i did not get any response.
Ajax is an out of band technology that does not require your page to reload. There are many, many examples for Ajax here and elsewhere. One thing to make sure to do is set AutoPostback to false on your dropdownlist so it does not postback
I know the language. I've read a book. - _Madmatt
-
hi sir, i am new in asp.net.sir i want to know that is there any java script with the help of which we can stop page reloading at the time of using ajax control.and dropdown text selection. sir i know that update panel can do this.but sir i do not want to use update panel.i mean i want to stop my page reload without using update panel while i am using ajax. please help me sir i am posting my this question again. because first time i did not get any response.
Do you have a reason you don't want to use an update panel? Your question is like asking about getting a nail into a piece of wood but refusing to use a hammer. When you make silly restrictions with no reasons behind them you are less likely to get help because you might dismiss other good solutions for no apparant reason as well.
-
Do you have a reason you don't want to use an update panel? Your question is like asking about getting a nail into a piece of wood but refusing to use a hammer. When you make silly restrictions with no reasons behind them you are less likely to get help because you might dismiss other good solutions for no apparant reason as well.
I would disagree. There are plenty of good reasons to not use an UpdatePanel. Refreshing a portion of a page does not require one to be used and it does add extra overhead that may not be necessary.
I know the language. I've read a book. - _Madmatt
-
I would disagree. There are plenty of good reasons to not use an UpdatePanel. Refreshing a portion of a page does not require one to be used and it does add extra overhead that may not be necessary.
I know the language. I've read a book. - _Madmatt
Of course. A nail doesn't require a hammer either. You could use a rock. And you can just pick up a rock without the overhead of a mining and smelting operation for the metal part of a hammer. But if I have a hammer and a rock on my work table, I am probably going to use the hammer. And if someone comes into my workshop and declares "no hammers allowed" for no apparant reason I will dismiss them as a nut and tell them to go away. The overhead is usually minimal when compared to the complexity and maintainability issues of most of the alternatives for someone who is new to ASP.Net as the asker stated. But we can let the asker decide. The following article discusses some of the trade-offs and alternate methods. UpdatePanel Tips and Tricks[^]
-
hi sir, i am new in asp.net.sir i want to know that is there any java script with the help of which we can stop page reloading at the time of using ajax control.and dropdown text selection. sir i know that update panel can do this.but sir i do not want to use update panel.i mean i want to stop my page reload without using update panel while i am using ajax. please help me sir i am posting my this question again. because first time i did not get any response.
Ok my friend thats too much use of "Sir" in your post... :-D
-
hi sir, i am new in asp.net.sir i want to know that is there any java script with the help of which we can stop page reloading at the time of using ajax control.and dropdown text selection. sir i know that update panel can do this.but sir i do not want to use update panel.i mean i want to stop my page reload without using update panel while i am using ajax. please help me sir i am posting my this question again. because first time i did not get any response.
Lets assume you have a combo box called
cmbList
and 3 labellblDisplayText
,lblDisplayValue
,lblSelectedIndex
on the page. use the following script to get the value and fill the labels...window.onload = function(){
var list = document.getElementById("cmbList"); // put the name of the combobox control
list.onchange = function(){
document.getElementById("lblDisplayText").value = list.options[list.selectedIndex].text;
document.getElementById("lblDisplayValue").value = list.options[list.selectedIndex].value;
document.getElementById("lblSelectedIndex").value = list.selectedIndex;
//window.alert("Selected item is " + list.options[list.selectedIndex].text + " and its option value is " + list.options[list.selectedIndex].value);
}
}to make sure you can remove commented code.
-
Ok my friend thats too much use of "Sir" in your post... :-D
:laugh: :laugh: Sir nobody and use Jquery Ajax look at this http://api.jquery.com/jQuery.ajax/[^] or read this http://mydevbank.com/ajax.aspx[^]