Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 25-09-2009
Member
 
Join Date: Oct 2008
Posts: 93
How to execute Server.Execute function in ASP.NET (C#)

I have problems when trying to execute (load) another page like the News Page when a user clicked a News button. When using VB and ASP 3.0, I did the clever dynamic include method of using "Server.Execute", but switching to ASP.NET and C#. Server.Transfer method will transfer the page to the destination page. That means User will able to see the Destination Page if any page defined in Server.Transfer Method.
Reply With Quote
  #2  
Old 25-09-2009
Member
 
Join Date: Apr 2008
Posts: 142
Re: How to execute Server.Execute function in ASP.NET (C#)

It didn't work but I tried the Redirect mothod from the Page.Response. But Server.Transfer(): It ends up the execution of current form and begins execution with new web form And Server.Execute():it begins execution with new web form but it still holds current web form .With the help of this we can combine the result of two web forms. Instead of using an asp.net hidden control on your user control, just use a regular html hidden input with the code tags <% %> to fill the data like this:
Code:
<input id="Hidden1"  type="hidden" value="<%= text %>"/>
Reply With Quote
  #3  
Old 25-09-2009
Member
 
Join Date: Jan 2006
Posts: 6,878
Re: How to execute Server.Execute function in ASP.NET (C#)

DotNetKicks uses it in the Global.asax file, to handle error pages, you might want to check it out. I receive compiler errors because the reference to "this" in Form2.aspx does not reference the same Page instance as created within the inherited code from Form1.aspx. About what happens when the user refreshes the page, nothing weird, the url in the address bar is requested again and the logic of the page begins from scratch, reissueing eventual Transfers or Executes.
Reply With Quote
  #4  
Old 25-09-2009
Member
 
Join Date: Mar 2008
Posts: 349
Re: How to execute Server.Execute function in ASP.NET (C#)

I have yet to have a valid use for Server.Execute(), Unlike the Server Side Includes (SSI) #exec command in IIS, which is used to run an executable file, or the SSI #include command, which is also used in ASP, the Server.Execute method is used with ASP pages to execute another ASP page. I receive compiler errors because the reference to "this" in Form2.aspx does not reference the same Page instance as created within the inherited code from Form1.aspx. It seem to me that leaving the original URL in the browser via a Server. Consequently, the "template" page is simply Form2.aspx which is a basic HTML page that is loaded by Form1.aspx and populates elements with the data loaded by the original Page class.
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "How to execute Server.Execute function in ASP.NET (C#)"
Thread Thread Starter Forum Replies Last Post
Taprats 0.8 not able to execute well Laramie Windows Software 6 28-03-2010 12:15 AM
Saw game is not able to execute well Sharanya Video Games 5 25-03-2010 01:47 AM
PHP: Execute cacls.exe Lambard Software Development 2 30-05-2009 09:33 PM
Execute vbscript Juan Garc?a Windows Server Help 4 15-05-2008 12:14 AM
How To Execute Iso File? Lupin Windows Software 3 27-04-2008 08:41 AM


All times are GMT +5.5. The time now is 11:32 AM.