|
If I understand you correctly and you are simply looking to navigate to a new page when the user clicks the link, you may wish to consider using a standard HTML anchor instead of the LinkButton.
If you choose to still use the LinkButton, set its OnClientClick attribute to return false; . For example:
<asp:LinkButton ID = "myLink" runat = "server" OnClientClick = "return false;" Text = "Hello" />
Hope that helps.
--Jesse "... the internet's just a big porn library with some useful articles stuck in." - Rob Rodi
|
|
|
|
|
If you need the server processing and do not need the page be posted back after processing, then at the server don't use Response.Redirect, instead use Server.Transfer, so when using this the page that will be sent back is the new page immediately.
|
|
|
|
|
When my asp.net code page open, there are 2 dataset object created. I need to dispose these datasets when user click back button. How can I find user click back button at IE menu? Please let me know.
|
|
|
|
|
You cannot directly detect the press of any browser button. You do have a couple of options for cleaning up, however.
First, in Global.asax , there is an event handler mapped for you called Session_End that will execute when the user's session expires. You could run your clean-up code there.
You could instead store your dataset objects in the Cache object of the current Http context. By doing so, you could set some cache policies that would be more aggressive in expiring the items. Note that this cache is shared accross user sessions, so you would want to use a key that is unique, such as Session.SessionId , to prevent sessions from interacting.
Another option is to use javascript to handle the onunload event for the body object. You could send an asynchronous request to a web service method on the server to perform your clean-up code for you. Note that the unload event will run whenever the page is unloaded from the browser, including when you perform a postback or navigate to another page in your site, so it can be difficult to determine when, exactly, you want to run your clean-up.
I hope that helps to get you started.
--Jesse "... the internet's just a big porn library with some useful articles stuck in." - Rob Rodi
|
|
|
|
|
Hi, I developed a custom webcontrol in which all resources (like images, javascript etc) are embedded. Since everything is embedded only single DLL is deliverable.
In the consumer page, its object is instantiated. Related html and resources gets rendered in the page response. Obviously the response gets heavier based on size of resources (plus lot of other toolkit generated files)
Now, this is a modalpopup feature which is not used daily so we want to make it on demand. Which means that we don't want to instantiate control's object every time the page renders. But will provide a link of page which user can click-on to view the feature in a modal popup. At the click, an AJAX call will be made and will pull the necessary information and html to be displayed.
The problem is how to download the embedded resources of webcontrol on AJAX call? It will also need the toolkit generated files too.
Any ideas will be appreciated? Thanks
Pankaj
|
|
|
|
|
Microsoft has provided an HTTP Handler in ASP.NET 2.0 and greater that performs this task for you. It goes by the name of webresource.axd . Google[^] has plenty of examples on its use.
Hope that helps.
--Jesse "... the internet's just a big porn library with some useful articles stuck in." - Rob Rodi
|
|
|
|
|
Can you still use asp pages instead of aspx pages with ASP.net 2.0.
I wrote some scripts in aspx since I am using VWD 2008 but I found a forum i like that is asp pages. All the aspx ones I can not seem to get working correctly since I am not that very good with them.
|
|
|
|
|
Classic ASP has its own ISAPI filter in IIS, and can peacefully coexist with any version of .NET, including in the same virtual directory. IIS simply invokes the classic ASP module to serve the request.
Things do become slightly tricky if you're trying to interact with the classic ASP pages from within your ASP.NET application, but it it still possible.
Hope that helps.
--Jesse "... the internet's just a big porn library with some useful articles stuck in." - Rob Rodi
|
|
|
|
|
well I actually found a free forum (YetAnotherForum) and I have trouble setting it up.. it is asp.net 2.0.. I get errors and I'm wondering if I should be setting this up on the server instead of my computer
|
|
|
|
|
Either location should be relatively the same experience. Unfortunately, I've never looked at the product. You may want to consider hitting their message boards. You'd have a better chance of finding a FAQ or knowledge expert on the product. Best of luck.
--Jesse "... the internet's just a big porn library with some useful articles stuck in." - Rob Rodi
|
|
|
|
|
Thanks hopefully I will figure it out lol
|
|
|
|
|
Hi Friends,
I created a app in asp.net 2.0 and i published app in IIS 5.1. Both are in my machine.
I've had a problem with session, but this problem is ocurring onlyu IIS 5.1. This problem doesn't ocurring when i debug the app.
The sessions are losing is postback and in other cases. But only IIS 5.1, in the asp.net 2.0 it dosoen't ocurr.
I've already tried all ways, but a I've not had success.
Can you help me?
Sorry form my English, but I brazilian guy and i'm improving my English.
Thanks!!
|
|
|
|
|
I think only iis 6 works with asp.net 2
|
|
|
|
|
.netman wrote: I think only iis 6 works with asp.net 2
Nope, IIS 5.1 works well
|
|
|
|
|
People,
I'm caming back because session in my app isn't working correctly.
I did a simple code:
in load method :
session("test")= "hello world"
in click button
response.write (session("test"))
What can I do?
|
|
|
|
|
Thanks,
i'm going to tray!!
In few minutes i'll aswer!!
|
|
|
|
|
Member 3015509 wrote: The sessions are losing is postback and in other cases. But only IIS 5.1, in the asp.net 2.0 it dosoen't ocurr.
This is not clear. Please explain it more. Also some sample code would be helpful
|
|
|
|
|
ah i was wrong didnt realise it works in 5 sorry!
|
|
|
|
|
|
I'm Sure,
When select item in listbox1, session is losed!!
Why is ocurring?? Is needin some configuration in IIS or asp.net 2.0?
Thanks,
|
|
|
|
|
Ok,
Let's go...
Code:
the first moment, this code is called in load method
****************************************
dim ds as dataset
ds = obj.list ' the method return a dataset of products
listbox1.DataSource = ds
listbox1.DataTextField = "Name"
listbox1.DataValueField = "ID"
listbox1.DataBind()
Session("ds") = ds
****************************************
the second moment, this code is called in detail method, when select a item in listbox1
****************************************
ds = Session("ds")
Dim dr() As DataRow = ds.Tables(0).Select("ID = " & listbox1.SelectedValue)
txtName.Text = dr(0)("Name")
txtDescript.Text = dr(0)("Descript")
lblNameSystem.Text = dr(0)("NameSystem")
****************************************
The Error:
Object not istance.
I identified that error is ocurring in Session("ds"), but is ocurring only IIS 5.1., in debug it isn't ocurrign.
Did you understand me?
Thanks,
|
|
|
|
|
Ok,
Let's go...
Code:
the first moment, this code is called in load method
****************************************
dim ds as dataset
ds = obj.list ' the method return a dataset of products
listbox1.DataSource = ds
listbox1.DataTextField = "Name"
listbox1.DataValueField = "ID"
listbox1.DataBind()
Session("ds") = ds
****************************************
the second moment, this code is called in detail method, when select a item in listbox1
****************************************
ds = Session("ds")
Dim dr() As DataRow = ds.Tables(0).Select("ID = " & listbox1.SelectedValue)
txtName.Text = dr(0)("Name")
txtDescript.Text = dr(0)("Descript")
lblNameSystem.Text = dr(0)("NameSystem")
****************************************
The Error:
Object not istance.
I identified that error is ocurring in Session("ds"), but is ocurring only IIS 5.1., in debug it isn't ocurrign.
Did you understand me?
Thanks,
|
|
|
|
|
Leandrão wrote: dim ds as dataset
Leandrão wrote: Object not istance.
I guess you haven't declared the dataset again in the event. Or you may consider declaring it outside the pageload. Also the page_load code should be put inside If not isPostBack block, else the dataset will be created and filled to session each time page posts back.
|
|
|
|
|
I hope casting required when assin session dataset to local object dataset.
I just modified your code as follows
the second moment, this code is called in detail method, when select a item in listbox1
****************************************
ds = DirectCast(Session("ds"), Dataset)
Dim dr() As DataRow = ds.Tables(0).Select("ID = " & listbox1.SelectedValue)
txtName.Text = dr(0)("Name")
txtDescript.Text = dr(0)("Descript")
lblNameSystem.Text = dr(0)("NameSystem")
****************************************
smile
|
|
|
|
|
Ok,
I'm going to see it.
Thanks
|
|
|
|