473,854 Members | 1,492 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Seeking advice - should I use server.transfer after a custom event fires?

I am using VS2005 to build a web form dynamically.

I'm using AddHandler to connect a custom event handler to the TextChanged
event of dynamically added textbox controls. Data entered in the
dynamically added textbox controls is saved to a database in the custom
event handler.

The custom event handler fires when the page posts back. I have a menu
control which causes a postback, and the custom event handler then fires if
a textbox was changed.

After the custom event handler is finished responding to TextChanged events,
the MenuItemClick event of the menu control fires. This loads a new page
based on the menu selection, which is captured in the MenuItemClick event.

Since I have to 're-add' the previous controls in the Page_Init event so the
custom TextChanged event will fire, the only way I could figure out to load
the new page was to use Server.transfer when the MenuItemClick event occurs.
I use a query string to pass along the menu selected value and other needed
data.

Is this the best way to manage this situation? It seems to work OK, but it
seems kludgy.

Thanks
Bill
Apr 12 '06 #1
3 1844
Typically, users would not expect changes to a textbox to save if they
didn't press a save / submit button. Is there a reason you want to
save when a menu item is selected? Or any other post-back causing
control?

Each textbox postback causes a separate database call? That seems a
little strange. Don't you have a submit button on the page to save all
the changes at once? If so, get rid of the change handler on each
textbox and check for changes on each textbox in the one button click
event (or in a method called by the event).

If you do that then you don't need to worry if another control besides
the submit button causes the postback.

Michael Lang
XQuiSoft LLC
http://www.xquisoft.com/

Apr 12 '06 #2
The page doesn't post back when the textbox is changed.

The page posts back when a menu selection is made. (There is also a save
button if the user doesn't want to display a new page after the changes to
the textboxes are saved, but that is not relevant to my question. I'm
trying to find the best way to go to a new page.)

After the page posts back (and the custom event fires, saving any changes to
text boxes) the MenuItemClick event fires, and I use server.transfer to
display a new page.

My question is whether server.transfer is the best way to accomplish this.
As I said, it seems kludgy.

Thanks
Bill

The page doesn't postback until the menu cont
"Mike" <mi**********@x quisoft.com> wrote in message
news:11******** **************@ e56g2000cwe.goo glegroups.com.. .
Typically, users would not expect changes to a textbox to save if they
didn't press a save / submit button. Is there a reason you want to
save when a menu item is selected? Or any other post-back causing
control?

Each textbox postback causes a separate database call? That seems a
little strange. Don't you have a submit button on the page to save all
the changes at once? If so, get rid of the change handler on each
textbox and check for changes on each textbox in the one button click
event (or in a method called by the event).

If you do that then you don't need to worry if another control besides
the submit button causes the postback.

Michael Lang
XQuiSoft LLC
http://www.xquisoft.com/

Apr 12 '06 #3
No, I would use Response.Redire ct.

Apr 13 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

24
2296
by: Joseph Geretz | last post by:
Up to this point, our application has been using Windows File Sharing to transfer files to and from our application document repository. This approach does not lend itself toward a secure environment and so we are in the process of imposing a WebService gateway between our application client and the repository. (As a starting point, the WebService won't be a richly featured application server; business rules are still implemented in the...
5
2763
by: Paul de Goede | last post by:
I set the Response.Filter in my aspnet application but I have noticed that if you do a Server.Transfer that the filter doesn't get called. And in actual fact the response is mostly empty. It seems that only scripts get rendered. I have seen this mentioned on this newsgroup before but with no resolution. Can anyone give any insight into this problem. Is there a work around? Manually push the Reponse.OutputStream through your filter after...
5
3766
by: Nedu N | last post by:
Hi All, I am facing a typical problem in my .NET application with the pop-up script messages. The thing is that its working fine when i run on my development machine but not running in expected manner when i move it to Prod environment. Please have a look at the following code snippet... //Page name - Add.aspx private void Page_Load(object sender, System.EventArgs e)
2
4374
by: RAJ | last post by:
In our multi-tier application, we have several ASP.NET user controls which will update the same data source provided by middle tier logic. In this particular scenario we have one user control displaying the contents of the data source, whilst another control updates the datasource via a command buttons implementation of 'Click', an event raised in the 'Handle Postback Events' stage of the control execution life cycle (via the...
9
2235
by: AFN | last post by:
I was just dropped into someone else's code (isn't that always so fun?). I can't figure out why a custom validation control's server event function is executing. There is nothing (that I see) in page_load, or elsewhere, that says page.validate, no control says "causesvalidation=true", and the AutoEventWireup is set to false. So I would think that the control's server event function would NOT execute, but it does execute right after...
4
5339
by: Lee Chapman | last post by:
Hi, Can anyone tell me why in the code below, the call to ClearChildViewState() has no effect? To paraphrase the code: I'm using view state. I have a textbox and a submit button (and a label that can be ignored). When I press the button the first time, the click handler hides the textbox. Pressing the button a second time unhides the textbox. The text box is maintaining its value when hidden via view state. (The value is NOT being...
8
3916
by: bryan | last post by:
I've got a custom HttpHandler to process all requests for a given extension. It gets invoked OK, but if I try to do a Server.Transfer I get an HttpException. A Response.Redirect works, but I really need to avoid the extra round-trip to the client. I've tried Passing the page name, the full URL, and the instance of the handler class to the Transfer method, but everything gets me the same error 500. Any help would be appreciated.
1
6341
by: Stu | last post by:
Hi, Im using vis studio 2003 and I think wse is out of the question as clients could be using java which doesnt support it. So I managed to find some code which allows you to develop a custom soap header called by using a http module. The problem Im having is I cannot seem to get the event to raise to fire off my authenticate method in the global.asax. The module is plumbed in to my web.config file Code Below:-
2
1648
by: Mike Placentra II | last post by:
Hi. When using Server.Transfer() to switch the request to a specific web form (as opposed to a class implementing IHttpHandler, if it makes any difference), do I have to do something special to have Request.IsAuthorized set properly? When searching for a solution I read that Server.Transfer() does not invoke the AuthorizeRequest event or something. Is there maybe a way to make that happen since the request is being transferred to a web...
0
9901
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10679
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10752
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9513
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7914
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7079
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5741
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5941
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4559
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.