Click here to Skip to main content
15,887,923 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: Error: The resource cannot be found. Pin
Member 876166711-Sep-14 9:03
Member 876166711-Sep-14 9:03 
AnswerRe: Error: The resource cannot be found. Pin
ZurdoDev11-Sep-14 9:06
professionalZurdoDev11-Sep-14 9:06 
GeneralRe: Error: The resource cannot be found. Pin
Member 876166711-Sep-14 9:15
Member 876166711-Sep-14 9:15 
AnswerRe: Error: The resource cannot be found. Pin
ZurdoDev11-Sep-14 9:31
professionalZurdoDev11-Sep-14 9:31 
GeneralRe: Error: The resource cannot be found. Pin
Member 876166711-Sep-14 9:33
Member 876166711-Sep-14 9:33 
SuggestionRe: Error: The resource cannot be found. Pin
Richard Deeming11-Sep-14 9:49
mveRichard Deeming11-Sep-14 9:49 
GeneralRe: Error: The resource cannot be found. Pin
Member 876166711-Sep-14 10:16
Member 876166711-Sep-14 10:16 
GeneralRe: Error: The resource cannot be found. Pin
Richard Deeming12-Sep-14 1:37
mveRichard Deeming12-Sep-14 1:37 
You don't really need the console application, unless you want to play with the methods. All you really need is:
VB
Public Class success
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        
        ' Store this in a local variable, so you're not repeatedly looking up the same item.
        ' Also, use Request.QueryString("Name") instead of Request("Name"), as you already know it's in the query string.
        Dim theName As String = Request.QueryString("Name")
        
        ' The value might be Nothing, or it might be an empty string:
        If Not String.IsNullOrEmpty(theName) Then
             
             ' Encode the value to display as text within an HTML context:
             Name.Text = HttpUtility.HtmlEncode(theName)
        End If

    End Sub

End Class


As for the page displaying your name as System.Web.UI.WebControls.TextBox, it sounds like you're doing something like:
VB
Response.Redirect(String.Format("success.aspx?name={0}", UserNameTextBox))

You need to pass the value of the TextBox, which is in the .Text property. You should also make sure that you properly encode the value - this time, for a URL:
VB
Dim theName As String = UserNameTextBox.Text
Dim encodedName = HttpUtility.UrlEncode(theName)
Response.Redirect(String.Format("success.aspx?name={0}", encodedName))




"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer


GeneralRe: Error: The resource cannot be found. Pin
Member 876166713-Sep-14 8:34
Member 876166713-Sep-14 8:34 
GeneralRe: Error: The resource cannot be found. Pin
Richard Deeming15-Sep-14 1:56
mveRichard Deeming15-Sep-14 1:56 
GeneralRe: Error: The resource cannot be found. Pin
Member 876166715-Sep-14 2:30
Member 876166715-Sep-14 2:30 
GeneralRe: Error: The resource cannot be found. Pin
ZurdoDev11-Sep-14 10:53
professionalZurdoDev11-Sep-14 10:53 
QuestionMVC jQuery dropdown context menu Pin
Stephen Holdorf11-Sep-14 3:35
Stephen Holdorf11-Sep-14 3:35 
QuestionViewstate spider web Pin
Ali Al Omairi(Abu AlHassan)10-Sep-14 22:20
professionalAli Al Omairi(Abu AlHassan)10-Sep-14 22:20 
AnswerRe: Viewstate spider web Pin
thatraja11-Sep-14 2:09
professionalthatraja11-Sep-14 2:09 
AnswerRe: Viewstate spider web Pin
Sibeesh KV29-Sep-14 1:21
professionalSibeesh KV29-Sep-14 1:21 
QuestionCurrent date Pin
Otekpo Emmanuel10-Sep-14 12:39
Otekpo Emmanuel10-Sep-14 12:39 
AnswerRe: Current date Pin
Ali Al Omairi(Abu AlHassan)10-Sep-14 22:08
professionalAli Al Omairi(Abu AlHassan)10-Sep-14 22:08 
GeneralRe: Current date Pin
Otekpo Emmanuel10-Sep-14 23:23
Otekpo Emmanuel10-Sep-14 23:23 
GeneralRe: Current date Pin
Ali Al Omairi(Abu AlHassan)11-Sep-14 1:29
professionalAli Al Omairi(Abu AlHassan)11-Sep-14 1:29 
GeneralRe: Current date Pin
Otekpo Emmanuel11-Sep-14 3:15
Otekpo Emmanuel11-Sep-14 3:15 
GeneralRe: Current date Pin
Richard Deeming11-Sep-14 3:50
mveRichard Deeming11-Sep-14 3:50 
GeneralRe: Current date Pin
Otekpo Emmanuel11-Sep-14 7:45
Otekpo Emmanuel11-Sep-14 7:45 
GeneralRe: Current date Pin
Richard Deeming11-Sep-14 7:50
mveRichard Deeming11-Sep-14 7:50 
GeneralRe: Current date Pin
Otekpo Emmanuel12-Sep-14 12:52
Otekpo Emmanuel12-Sep-14 12:52 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.