|
|
I've corrected the post... there is a problem when i write asp:label ...
By the way how can i submit a form in a VBS function??
|
|
|
|
|
Bruno Lemos wrote:
I've corrected the post... there is a problem when i write asp:label
OK. System.Web.UI.WebControls.TextBox asp control does not have a Value property. You have to do tNome.Text on the server side.
Bruno Lemos wrote:
By the way how can i submit a form in a VBS function?
Do you mean how to run a client-side function on submit? This is why you should use Custom Validator - it will take care of it for you - you will be able to specify client-side and server-side validation functions. It is very simple, just look at the link I gave you.
|
|
|
|
|
ok thanx for your help. is it possible this?
validate a field, if its not valid, appears a red label "Incorrect Entry"
if its valid submits the form to another page (page2.aspx)?
thanx again
|
|
|
|
|
You don't submit the form to the other page per say, instead you validate everything in this page and then redirect user to the other page. For example, in your Page_Load or myButton_Click event handler functions on the server side you can do this:
If Page.IsValid Then
Response.Redirect("page2.aspx")
End If
|
|
|
|
|
ok..
sorry being so newbie
one more question please:
when i redirect to page2.aspx is it possible to get the value of the field with Request.Form["tName"] in order to insert it in a Db?
|
|
|
|
|
Not if you redirect. You could store it into a Session variable, but it is probably better to do a Server.Transfer("page2.aspx") instead of Redirect than. If you do the transfer you will be able to do Request.Form("...") in the other page.
|
|
|
|
|
ok thanx for all your help... i'll try some stuff with your tips and if i have more questions i'll post them ok? thanx again
|
|
|
|
|
Hi All !
I know a best domain & hosting services
Domain $15/year , Hosting $1/month at www.clicknhost.com
Kalaji
|
|
|
|
|
What happened to the HTML/CSS Article section? I cannot find it in the left hand bar on the home page. The folders still exist (I checked my first article and it was still there.)
Am I just missing it? Also ASP is not there, though I guess ASP is being put into the .NET section.
Still, what happened to the HTML/CSS Article section?
regards,
Paul Watson
Bluegrass
Cape Town, South Africa
"The greatest thing you will ever learn is to love, and be loved in return" - Moulin Rouge
Martin Marvinski wrote:
Unfortunatly Deep Throat isn't my cup of tea
Do you Sonork? I do! 100.9903 Stormfront
|
|
|
|
|
Everything is sill there as far as I can see. I think you need to select All Topics tab to see it.
What I want to know is what happened to article submission wizard. It says it is temporary unavailable. I have an article to submit and now I am not sure if I should just email it to Chris or wait for wizard to come back. The thing is that I don't know if it is down for a long time now or is it just today or what...
|
|
|
|
|
Konstantin Vasserman wrote:
I think you need to select All Topics tab to see it.
Aahhhh Thanks Konstantin.
Konstantin Vasserman wrote:
What I want to know is what happened to article submission wizard
Me too, was about to submit a second article and found the wizard down. I assume Chris is improving it no end So the wait, not sure how long, should be worth it.
regards,
Paul Watson
Bluegrass
Cape Town, South Africa
"The greatest thing you will ever learn is to love, and be loved in return" - Moulin Rouge
Martin Marvinski wrote:
Unfortunatly Deep Throat isn't my cup of tea
Do you Sonork? I do! 100.9903 Stormfront
|
|
|
|
|
Paul Watson wrote:
Me too, was about to submit a second article and found the wizard down. I assume Chris is improving it no end So the wait, not sure how long, should be worth it.
Well, according to Chris there is a problem with it that they are trying to fix and they hope to get it working soon. So we'll just wait. Maybe I should write another article while waiting - I still have 20 more to go to get my platinum membership status...
|
|
|
|
|
Hai,
Its surprising me, that no one discusses about the traditional . It didnt work. Because the submit button always tries to call the Page_Load function of the same page.
Surprising enough, none of Microsoft's documentation discusses about the action attribute. Wondering whether it is not required since the form itself is running on the server.
Then how would I jump to a different page?
omkamal
|
|
|
|
|
Doesn't Response.Redirect() work anymore?
|
|
|
|
|
But why do I want to use Redirect? Why not posting form values to a different page by calling that page? Like what we used to do in ASP.
omkamal
|
|
|
|
|
In ASP it was a different story: you had one page with HTML form and one page with ASP code to process the data. Now you can do it all in one page without creating a mess out of your code and without having all those extra pages. That is one of the good things about ASP.NET, as far as I concern...
|
|
|
|
|
Lets say I have a login form. It takes username and password and based on this authentication I would have to display (possibly in another page) an xml data in a datagrid. Now how would I do this all in one page. I cannot play hide-seek with my controls in the page. I would rather have it in a different page. Am I right?
omkamal
|
|
|
|
|
Before:
login form submitted to page2.asp
page2.asp checks credentials
if credentials not valid you send them back to login.asp
if valid you return XML.
Now:
login.asp submits to itself
you check credentials on page_load or button_clicked
if credentials not valid you do nothing
if valid you send them to page2.asp via Redirect.
All the code that relates to logging in is now in one place and not spread across multiple pages. All the code that concerns displaying of the XML is in the separate page. Much cleaner solution IMO.
|
|
|
|
|
Sounds great though. But my surprise is, what if I wanted login info in my page2.aspx? What is the use of HttpRequest class in .NET? What is the use of NameValue collection then?
If I check the credentials in the same page (page1.aspx), then I dont need to access the formcollection. I can simply use the ids of these controls right?
So, Is Response.Redirect() the ONLY way to jump to a different page in ASP.NET????
omkamal
|
|
|
|
|
If you want login info in page2.aspx you will probably want it in many more other pages. Just store it in Session variable and check this variable in every page.
Yes since your page1.asp doing all the login stuff you can refer to username textbox as if it was a server object:
if( txtUsername.Text == "blah" )
or
If txtUsername.Text = "blah" Then
you don't have to do Request.Form() stuff.
Server.Transfer() is better than Response.Redirect() because it does not do a round trip to client and back it just transfers control to another page.
|
|
|
|
|
BTW, you can still use client side forms as before just take out runat="server" part in your form tag. But you will not be able to take advantage of all the server side ASP components.
|
|
|
|
|
Now, are we concluding that posting form collection to a different aspx page is not possible???? Thats bad.
May be my login info is needed in different other pages so I can use session variables. But what if I have one variable that I need it only for page2.aspx. I dont have to go to session variable.
Ok. Lets give this up. If you find any info about sending values to a different page please let me know and so do I.
Thanks.
omkamal
|
|
|
|
|
Forms Authentication is now built in to asp.net
you can read about it here:
http://www.gotdotnet.com/quickstart/aspplus/doc/formsauth.aspx
|
|
|
|
|
omkamal wrote:
Then how would I jump to a different page?
Ok if all you want to do is jump to a different page then use response.redirect(), use a normal hyperlink or use javascript.
But I think you mean you want to submit a form, carry over the form data and process it on another page.
Your problem is that you are trying to apply ASP thinking to ASP.NET. The biggest bonus of ASP.NET is that it handles "state" for you. You build a form as per normal, don't worry about the action attribute though, and the submit button is then linked to a procedure (when you build your form just double click the submit button, in the IDE, and you will see). In the procedure you have the code which handles the form data. I just type "strFirstName = frmMain.txtFirstName" in the procedure and it works. ASP.NET handles it all for you.
I recommend you go through The ASP.NET Page Life Cycle and ASP.NET Code Behind Pages, and remember to stop thinking in old ASP terms. ASP.NET is rather different, and RATHER better
regards,
Paul Watson
Bluegrass
Cape Town, South Africa
"The greatest thing you will ever learn is to love, and be loved in return" - Moulin Rouge
Martin Marvinski wrote:
Unfortunatly Deep Throat isn't my cup of tea
Do you Sonork? I do! 100.9903 Stormfront
|
|
|
|