|
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
|
|
|
|
|
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
|
|
|
|
|
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[^]
|
|
|
|
|
Ok my friend thats too much use of "Sir" in your post...
|
|
|
|
|
|
Lets assume you have a combo box called cmbList and 3 label lblDisplayText , 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");
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;
}
}
to make sure you can remove commented code.
|
|
|
|
|
Hi to all,
I know its a common question. But I want to share something. Actually I am working on e-commerce portal. It consists of 32000 products with around 2500 categories. I used 3-tier architecture for this project. Everything is coming using stored procedures. I used master pages as well.
But still I am fighting with the performance issue. Can anyone please tell me some useful steps to increase the speed of the website. Its taking ages to load the pages.
waiting for your assistance....
cheers,
sneha
|
|
|
|
|
First question might be: are you loading all of the records into a grid at startup? Perhaps you should look at only loading an appropriate subset of records.
You could also look at caching data and settings that don't change very often.
There are also a couple of articles on CP (you'll have to find them for yourself) which give good tips on how to optimise your application.
You could also use analysis tools (like Fiddler) to see what the application is doing or analyse the stored procedures; look at the explain plans and try to speed them up. Do they have the correct/any indexes?
That barely scrathces the surface and is a guess about your needs: you should be more specific about where the bottlenecks are occurring but should get you started.
me, me, me
"The dinosaurs became extinct because they didn't have a space program. And if we become extinct because we don't have a space program, it'll serve us right!"
Larry Niven
|
|
|
|
|
In addition to other ideas I would suggest to fire up a profiler like the one from redgate (ants profiler it is, i believe) to see what takes so long to render your page.
When in trouble,
when in doubt,
run in circles,
scream and shout
|
|
|
|
|
Agree with digital man. First thing to look at is SQL.
Also, does the site have images for the products? Are these optimized? How are they handled? Are you storing in db?
Need to see some code to help more...
|
|
|
|
|
what about caching ? and how long takes a page to render?
|
|
|
|
|
Hiiiiiiiiiiiiiiiii,
I am trying to access session variable value from the
'Application_BeginRequest' handler in the global asax file but get the
message - 'Session state not available in this context'
therefore I use
:
void Application_BeginRequest(object sender, EventArgs e)
{
string p = Request.Path.Substring(Request.Path.LastIndexOf("/") + 1);
if (p != "exit.aspx")
{
Session.Add("myPath", p.ToString());
}
}
but the session state is not available in this context. is there another way to do this?
thanks.
modified on Tuesday, March 30, 2010 7:54 AM
|
|
|
|
|
This is just a suggestion, just give it a shot.
I think you would get this error only on the first request to your application. Check if the session is empty and if so do nothing, else add the page to your session.
Alternate suggestion - why not use the SessionStart for the first request and beginrequest for the subsequent request?? You can handle it by using the above suggestion.
BTW, looking at what you are trying to do, I think there is a control that can provide this functionality without much code [SiteMapPath]. Find details here[^] and here[^]
|
|
|
|
|
thank you very much,
I understand that Apllication_BeginReguest
event is fired for every hit to every page in the site
Therefore i want check path in application_beginrequest event and store in session["mypath"] and if session["maypath"]
not equal whit exit.aspx then onlineuser--
session["mypath"] created in session_Start event,
i use this code:
HttpContext.Current.Session["mypath"] = Request.Path.Substring(
Request.Path.LastIndexOf("/") + 1);
but get the error 'Object reference not set to an
instance of an object'
summary:
i want when exit.aspx is closed then onlineuser--
Now,how to i can understand that exit.aspx is closed or opened??
Anyone know how you get at this??
Thanks in advance.
modified on Tuesday, March 30, 2010 9:18 AM
|
|
|
|
|
What exactly are you trying to accomplish? Everywhere that has access to Session has access to the Request object as well. Adding the information you already have in the request is just wasting memory.
|
|
|
|
|
Hi,
I have to pass an array from a java file to a WebService that I have created in .Net
May I know how I could go about doing this?
Thanks in advance.
|
|
|
|
|
|
Thank you for the reference.
|
|
|
|
|
how to bind view to gridview control using asp.net with c#
the view is al ready created in sql server . then how to bind to the gridview control
please give suitable example
|
|
|
|
|
fetch view in datatable and bind datatable to gridview.
|
|
|
|
|
use simple qry select * from dbo.yourView
|
|
|
|
|
Try this: open the page in design view. From the toolbox select a SqlDataSource. Drop onto the page. Click on 'Configure Data Source'. Follow the instructions. Set the DataSource of the grid to the SqlDataSource.
There are many other ways of doing this but this is probably the easiest.
me, me, me
"The dinosaurs became extinct because they didn't have a space program. And if we become extinct because we don't have a space program, it'll serve us right!"
Larry Niven
|
|
|
|
|
check this article
http://opexsolution.com/forum/viewtopic.php?f=16&t=9
|
|
|
|