,text and why is there , begin of text ?? i use Response.Redirect(String.Format("asanat.aspx?TextBox1={0}&TextBox2={1}&TextBox3={2}&TextBox3={3}", Label1.Text, Label2.Text, Label3.Text, Label4.Text))

hello friends

,text and why is there , begin of text ?? i use

label4.text="text"

Response.Redirect(String.Format("asanat.aspx?TextBox1={0}&TextBox2={1}&TextBox3={2}&TextBox3={3}", Label1.Text, Label2.Text, Label3.Text, Label4.Text)) from masterpage1.master

and asanat.aspx connect to masterpage2.master.. below code is in masterpage2.master because label4.text in masterpage2.master

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

If Request("TextBox3") IsNot Nothing Then

Label4.Text = Request("TextBox3")

End If


Mark as me if my question or my answer can be helpful for you :)
0
oguzkaygun
6/16/2008 11:08:29 AM
asp.net.state-management 8807 articles. 0 followers. Follow

7 Replies
1241 Views

Similar Articles

[PageSpeed] 48

you should use UrlEncode() for the values of your textboxes before you submit them in the address:

Response.Redirect(String.Format("asanat.aspx?TextBox1={0}&...", UrlEncode(Label1.Text), ...)

and decode those values using UrlDecode():

Label4.Text = UrlDecode(Request("TextBox3"))


as for your problem, your address has 2 TextBox3 parameters : asanat.aspx?TextBox1={0}&TextBox2={1}&TextBox3={2}&TextBox3={3}

so when you use Request("TextBox3"), if Label3.Text is "" and Label4.Text is "text" you get ",text" (the 2 values separated by a comma).

0
BigjimFRG
6/16/2008 11:59:24 AM

hi

thank you for your reply :)

i changed textbox3 to newword and it run now

i have two question.. i hope that you go on help me :)

what will happen if i dont use UrlEncode and UrlDecode? because my code run now and i dont use url encode and urldecode now.

my second question is.. my datetime problem.. for example 14.06.2008.. when 14 less than 12, my inserting run.. but if Day>12, my inserting doesnt run..

sds.InsertParameters.Add("ilanbaslangictarihi", datetime.now())  'it is my code line.. what should i do ?

cheers


Mark as me if my question or my answer can be helpful for you :)
0
oguzkaygun
6/16/2008 12:46:01 PM

UrlEncode and UrlDecode ensures that special characters such as & or ? will not ruin your address by encoding it (for instance %20 instead of a space). but if you're confident you don't need it, do not use it ;-)

As for your DateTime issue, try using the DateTime.Parse() or DateTime.ParseExact() methods (http://msdn.microsoft.com/en-us/library/w2sa9yss(VS.80).aspx) so you can specify the date format.

0
BigjimFRG
6/16/2008 2:11:53 PM

hi

thank you for your reply :)

i see.. my ' characther was not run.. it will run by encode :) but when i write urlencode, it have underline.. should i add imports **** line for visual basic of visual web developer ?

and i saw and read parse article yesterday but i couldnt understant it.. i tried but i couldnt be successful..

cheers


Mark as me if my question or my answer can be helpful for you :)
0
oguzkaygun
6/16/2008 2:19:15 PM

UrlEncode and UrlDecode are part of the System.Web.HttpUtility namespace. you should be able to use HttpUtility.UrlEncode(...) without adding anything since the System.Web reference already exists in the web page.

about parsing a date and time, try this :

// Reverse month and day to conform to a different culture.
// The date is Feburary 16, 1992, 12 hours, 15 minutes and 12 seconds.
        IFormatProvider culture = new CultureInfo("fr-FR", true);
        string myDateTimeFrenchValue = "16/02/1992 12:15:12";
        DateTime myDateTimeFrench = DateTime.Parse(myDateTimeFrenchValue, culture, DateTimeStyles.NoCurrentDateDefault);

and then try to replace the hardcoded date ("16/02/1992 ...") by your input date and then the culture ("fr-FR" - French) by your culture - see http://msdn.microsoft.com/en-us/library/system.globalization.cultureinfo(VS.80).aspx.

0
BigjimFRG
6/16/2008 3:44:24 PM

hi

thank you for your reply :)

cultureinfo has underline.. should i add using or imports for begin of page.aspx.vb ?

also datetimestyles has underline.. i found it.. imports system.globalazitaon

cheers


Mark as me if my question or my answer can be helpful for you :)
0
oguzkaygun
6/16/2008 4:01:11 PM

hi

thank you for your reply :) i tried below codes but it doesnt work. what should i do ?

Dim culture As IFormatProvider = New CultureInfo("fr-FR", True) ' i have tried for "tr-TR" i am from Turkey :)

Dim myDateTimeFrenchValue As String = "10/06/2008 12:15:12" it is run but 16/06/2008 not run(error is floating syntax...) also 06/16/2008 not run (error message is date culture not definet)

Dim myDateTimeFrench As DateTime = DateTime.Parse(myDateTimeFrenchValue, culture, DateTimeStyles.NoCurrentDateDefault)

sds.InsertParameters.Add("timeone", myDateTimeFrench)

cheers


Mark as me if my question or my answer can be helpful for you :)
0
oguzkaygun
6/16/2008 6:40:29 PM
Reply:

Web resources about - ,text and why is there , begin of text ?? i use Response.Redirect(String.Format("asanat.aspx?TextBox1={0}&TextBox2={1}&TextBox3={2}&TextBox3={3}", Label1.Text, Label2.Text, Label3.Text, Label4.Text)) - asp.net.state-management

Resources last updated: 12/23/2015 8:35:06 AM