Saturday, March 31, 2012

Where did Request("email") go?

I have a 2-page site. The first page default.aspx contains 2 Webform fields: Email and Zipcode. These 2 fields are validated using the built-in validation. When successful, I just want the 2 values to appear in the second page (default2.aspx) in 2 new textboxes. Request("email") and Request("zipcode") won't do it. Is it much more complicated in asp.net? Please help.Request("email") is looking for a form element or querystring variable.
How are you going from Page1 to Page2, is there a form submitted?
Yes there is a form in the first page. In the submit button .Click, I programmed it to do a Response.Redirect to default2.aspx.
then you must redirect to default2.aspx?email=xxxx, etc., because your Redirect is causing the form NOT to be submitted.

(or change the form submit to regular html submit button, and not a server control)
Thanks! It works! Here's my revised redirect string:

Response.Redirect("default2.aspx?Email=" & email.Text)

I just thought that there was a new way of passing parameters in asp.net ("postback"?).
Is there a Webform element equivalent to the traditional hidden form field? I want to store the values from the first page. Default2.aspx is also a form that will submit values from the first page (like Step one, Step two style online forms).
use a textbox control
set Visible=False
Why are you passing values to a second page.. that defeats the whole point of viewstate. what you are actually doing is submitting the form, thus creating a new request to the server... and then you are redirecting, which is also another request to the server. Why? Why not just use the same page to do the processing on the form's elements.
Thanks for the replies.

I need a second page because the creative on the first page is a simple "zipcode" only promotion. The creative on the first page is different than on the second page. When a user enters a zipcode, an affiliate gets paid.

The second page is a also a form that when filled out by the user, the affiliate also gets paid but at a much lower rate because there are more fields to fill out. The creative on this page is different in an attempt to lure the user to fill it out.

Therefore, since these are 2 different looking pages, it's more practical to create 2 pages especially when working alongside a web designer.

Where did my webpage go?

I've got some typical friday afternoon issue.

When I visit/debug a webpage (which worked before), I get a blanc page.

When I view the source in the browser, al the code has rendered and it looks ok.

I tested, with some static text just after the <form> tag, but the text is not show either.

What is wrong?

weird error -- asp.net might have lost its mappings

if you just type in "test" on default.aspx with nothing else does it show up?

might need to register asp again


I commented out a lot of code and found that the external javascript file is causing the problem.

So I commented out all javascript code in the file. But the problem still exists.

<

headrunat="server"><title>My Title</title><linkhref="css/main.css"rel="stylesheet"type="text/css"/><scriptsrc="parameter_overview.js"/>

</

head>

I tried all kind of things, changing the src (url), adding the "type" attribuut, adding the "language" attribute.
Problem keeps existing.

What goes wrong or what could I test?


I found the problem!!!

You have to use a closing tag, and can not use the < /> shortcut.

<scriptsrc="parameter_overview.js"type="text/javascript"></script> = OK<scriptsrc="parameter_overview.js"type="text/javascript" /> = NOT OK

Where did the Build Comment Web Pages too go?

In VS 2003 there was a menu item 'Tools' -- > 'Build Comment Web Pages'. Is
that function in VS 2005? I haven't been able to find it, nor is it in
Help.
Thanks!
VelvetHi Velvet,
Thank you for posting.
As for the "Build Comment Web Pages" function, it does be one of the items
that was removed from VS 2003 to VS 2005. Actually, the original one in VS
2003 is a simple document generation helper while there has many 3rd party
document generation component like NDoc can provide sophisticated doc
generation and integrated with vs ide. And currently the NDoc is also
planning a new version to support .NET 2.0, you can search the NDOC's space
to get more info.
BTW, as for VS 2005, it provide a simple Automation sample add-in which can
help generate comment pages, you can also have a look at it to see whether
it helps:
#Visual Studio .NET: Automation Samples
http://www.microsoft.com/downloads/...9710-6DF7-4F3F-
A5AE-425A478DDEEB&displaylang=en&displaylang=en
Hope this helps.
Regards,
Steven Cheng
Microsoft Online Community Support
========================================
==========
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
========================================
==========
This posting is provided "AS IS" with no warranties, and confers no rights.
Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Where did the Build Comment Web Pages too go?

In VS 2003 there was a menu item 'Tools' -- > 'Build Comment Web Pages'. Is
that function in VS 2005? I haven't been able to find it, nor is it in
Help.

Thanks!
VelvetHi Velvet,

Thank you for posting.

As for the "Build Comment Web Pages" function, it does be one of the items
that was removed from VS 2003 to VS 2005. Actually, the original one in VS
2003 is a simple document generation helper while there has many 3rd party
document generation component like NDoc can provide sophisticated doc
generation and integrated with vs ide. And currently the NDoc is also
planning a new version to support .NET 2.0, you can search the NDOC's space
to get more info.

BTW, as for VS 2005, it provide a simple Automation sample add-in which can
help generate comment pages, you can also have a look at it to see whether
it helps:

#Visual Studio .NET: Automation Samples
http://www.microsoft.com/downloads/...9710-6DF7-4F3F-
A5AE-425A478DDEEB&displaylang=en&displaylang=en

Hope this helps.

Regards,

Steven Cheng
Microsoft Online Community Support

==================================================

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

where did they come from?

Hi..is there a way to tell where users came from in a
particular page in asp.net? how do i know what page(web
form, within my site) are they coming from without
abusing querystrings? i would greatly appreciate any help.Try
Request.UrlReferrer

"ska4reak" <ska4reak@.yahoo.com> wrote in message
news:0b6301c3aaca$6ab13560$a501280a@.phx.gbl...
> Hi..is there a way to tell where users came from in a
> particular page in asp.net? how do i know what page(web
> form, within my site) are they coming from without
> abusing querystrings? i would greatly appreciate any help.

where did the methods for a component go

Hello,
Using VWD 2005 here... I have a GridView and for usability, the edit
template for one of the columns was changed from the defaut to a
calendar control.
Also, I have some content which I want to add to the calendar...
something akin to this MSDN example...
http://www.asp.net/QuickStart/util/...r/Calendar5.src
On the code behind page, where the class and method name comboboxes
are, the calendar and it's methods isn't there! What happened to the
component and its methods? To put custom content in the calendar, like
the example, the DayRender method is needed.
Suggestions are greatly appreciated.
Thanks!Hi all,
A w ago, I tried something like this to get access to a calendar's
methods which are part of the edit item template in my gridview:
Dim WithEvents myCalendar As New Calendar
Protected Sub GridView1_RowDataBound(ByVal sender As Object,
ByVal e As
System.Web.UI.WebControls.GridViewRowEventArgs) Handles
GridView1.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
myCalendar =
Me.GridView1.Rows(myRow).FindControl("Calendar1")
AddHandler calView.DayRender, AddressOf
calView_DayRender
End If
End Sub
This fails miserably with a null reference exception. I'm as
to why it's looking for the new keyword here... is that for the event
handler then?
So after some more reading, I tried this...
'
'
'
Protected Sub GridView1_Load(ByVal sender As Object, ByVal e
As System.EventArgs) Handles
GridView1.Load
Dim editField As New TemplateField
editField.EditItemTemplate = New
CompiledBindableTemplateBuilder(AddressO
f buildCalendar, Nothing)
GridView1.Columns.Insert(3, editField)
End Sub
'
'
'
Sub buildCalendar(ByVal ctl As Control)
Dim ipa As IParserAccessor = ctl
Dim cal As Calendar = New Calendar
cal.TemplateControl = Me
cal.ID = "editCalendar"
AddHandler cal.DayRender, AddressOf renderCalendar
ipa.AddParsedSubObject(cal)
End Sub
'
'
'
Sub renderCalendar(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.DayRenderEventArgs)
Dim myCal As Calendar = CType(sender, Calendar)
myCal.ID = "editCalendar"
'
' stuff which follows would be for the calendar cell
background color and text rendering one can do in
' DayRender...
'
End Sub
This solution does indeed make an edit item template with a calendar as
the component... but there are two problems...
1. I want the edit item to be a part of column 3. But what this thing
does is create a totally new column at runtime, inserts it, and shifts
the other columns one index to the right.
2. When a user clicks a day an additional, blank, column is added to
the grid.
Can anyone help with the 2 problems I still have? Thanks!

where did the methods for a component go

Hello,

Using VWD 2005 here... I have a GridView and for usability, the edit
template for one of the columns was changed from the defaut to a
calendar control.

Also, I have some content which I want to add to the calendar...
something akin to this MSDN example...
http://www.asp.net/QuickStart/util/...r/Calendar5.src

On the code behind page, where the class and method name comboboxes
are, the calendar and it's methods isn't there! What happened to the
component and its methods? To put custom content in the calendar, like
the example, the DayRender method is needed.

Suggestions are greatly appreciated.

Thanks!Hi all,

A week ago, I tried something like this to get access to a calendar's
methods which are part of the edit item template in my gridview:

Dim WithEvents myCalendar As New Calendar

Protected Sub GridView1_RowDataBound(ByVal sender As Object,
ByVal e As
System.Web.UI.WebControls.GridViewRowEventArgs) Handles
GridView1.RowDataBound

If e.Row.RowType = DataControlRowType.DataRow Then
myCalendar =
Me.GridView1.Rows(myRow).FindControl("Calendar1")
AddHandler calView.DayRender, AddressOf
calView_DayRender
End If

End Sub

This fails miserably with a null reference exception. I'm confused as
to why it's looking for the new keyword here... is that for the event
handler then?

So after some more reading, I tried this...

'
'
'
Protected Sub GridView1_Load(ByVal sender As Object, ByVal e
As System.EventArgs) Handles
GridView1.Load
Dim editField As New TemplateField
editField.EditItemTemplate = New
CompiledBindableTemplateBuilder(AddressOf buildCalendar, Nothing)
GridView1.Columns.Insert(3, editField)
End Sub

'
'
'
Sub buildCalendar(ByVal ctl As Control)
Dim ipa As IParserAccessor = ctl
Dim cal As Calendar = New Calendar
cal.TemplateControl = Me
cal.ID = "editCalendar"
AddHandler cal.DayRender, AddressOf renderCalendar
ipa.AddParsedSubObject(cal)
End Sub

'
'
'
Sub renderCalendar(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.DayRenderEventArgs)

Dim myCal As Calendar = CType(sender, Calendar)
myCal.ID = "editCalendar"

'
' stuff which follows would be for the calendar cell
background color and text rendering one can do in
' DayRender...
'
End Sub

This solution does indeed make an edit item template with a calendar as
the component... but there are two problems...

1. I want the edit item to be a part of column 3. But what this thing
does is create a totally new column at runtime, inserts it, and shifts
the other columns one index to the right.

2. When a user clicks a day an additional, blank, column is added to
the grid.

Can anyone help with the 2 problems I still have? Thanks!