The ProgrammersTalk Community
Forum Register Search Today's Posts Mark Forums Read
Register

Go Back   The ProgrammersTalk Community > Web Programming > ASP / ASP.NET


Welcome to the The ProgrammersTalk Community forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.
Tags:

Closed Thread
 
LinkBack Thread Tools    Display Modes   
  #1 (permalink)  
Old 06-10-2007, 04:57 PM
Persian
Posts: n/a
[SOLVED] ASP.NET funny problem!!!?

I insstalled .NET v2.0.50727.42, i have two pages, Get.aspx and Save.asp. There is a server side form in the Get.aspx:

<form runat="server" action="Save.aspx" name="GetData">

But after runnging page when i click on the Submit button it return to Get.aspx, in the page source form's action property changed to Get.aspx, but i wrote it Save.aspx in the source file!!!
How can i solve it?
In the browser's source view:
<form action="Get.aspx" name="GetData">
and, inside the form in Get.aspx i used ASP.NET controls, i can't move runat="server" !

__________________

Digg this Post! Del.Icio.Us this Post! Technorati this Post! Furl this Post! Mister Wong this Post! Newsvine this Post! Spurl this Post! Reddit this Post! Netscape this Post!
  #2 (permalink)  
Old 06-10-2007, 04:57 PM
fyodor myshkin
Posts: n/a
Well, first thing to note is that you are mixing two technologies. You really don't need an aspx page to do a conventional Post. That being said, you should just replace the runat="server" from your form with method="post". Do this unless you plan on using your code-behind to process the form.

Next, open your Save.aspx page so that you can view the source. Place the following above the html code and under your Page directive (I'm using C sharp but you could easily change it to VB ):

<script language=cs runat=server>
void Page_Load(object sender, System.EventArgs e)
{
myLabel_id.Text = Request.Form("myFormElementName").toString();
}
</script>

Now, inside the <form> tags of your Save.aspx page put the following: <asp:Label id="myFormElementName" run="server" />

run your get.aspx page and the results should post on your save.aspx page.

__________________

Digg this Post! Del.Icio.Us this Post! Technorati this Post! Furl this Post! Mister Wong this Post! Newsvine this Post! Spurl this Post! Reddit this Post! Netscape this Post!
  #3 (permalink)  
Old 06-10-2007, 04:57 PM
Smutty Smutty is offline
Novice
Join Date: Jun 2007
Posts: 9
iTrader: (0)
Smutty is on a distinguished road
I agree with the post above me, you are mixing between two technologies.

To post your page to another page, simply set the PostBackUrl property of the button or control which you wish to post to Save.aspx.

This property takes a string value that points to the location of the file to which this page should post. In this case, it is Save.aspx. This means that Save.aspx now receives the postback and all the values contained in the Get.aspx controls.

However all this is not needed. All you need is one page.

Hope this helps.

__________________
Powered by Yahoo! Answers
Digg this Post! Del.Icio.Us this Post! Technorati this Post! Furl this Post! Mister Wong this Post! Newsvine this Post! Spurl this Post! Reddit this Post! Netscape this Post!
Closed Thread


Thread Tools
Display Modes

   Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -7. The time now is 03:50 PM. Powered by vBulletin
Copyright © 2000 - 2007, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO © 2007 ProgrammersTalk Sedo - Buy and Sell Domain Names and Websites project info: programmerstalk.net Statistics for project programmerstalk.net etracker® web controlling instead of log file analysis


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50