473,406 Members | 2,713 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

query string doubt in aps.net andC#

375 256MB
Hi,

I redirect to a page in the below manner

Client.aspx?FROMDATE=" + text3 + "&TODATE=" + text4 + "&STOP=" + text24 + "&MAIL=" + text1

I came to notice that we cannot pass the character #,
if we pass the character # the characters succeeding that got truncated.

Is this ok. Or do we have some other way of sending querystrings which consists of the character #
Apr 15 '08 #1
4 1055
balame2004
142 100+
Hi,

I redirect to a page in the below manner

Client.aspx?FROMDATE=" + text3 + "&TODATE=" + text4 + "&STOP=" + text24 + "&MAIL=" + text1

I came to notice that we cannot pass the character #,
if we pass the character # the characters succeeding that got truncated.

Is this ok. Or do we have some other way of sending querystrings which consists of the character #
Hi,

Have you tried session object?

session object is used to pass information between web pages within an web application. It is good way to transfer complicated and large objects.

Cheers,
Balaji U
Apr 15 '08 #2
kunal pawar
297 100+
right u can not pass # in querystring but u can pass its code through url and then decode it.
Other solution is use hidden variables
Apr 15 '08 #3
Curtis Rutland
3,256 Expert 2GB
The Session object is a really good idea. You could create a custom class with attributes of all the variables you need to pass with the query string, and then pass an instance of that object. Or, you could pass several strings, and they will be hidden from the user, so it is more hack-proof. You can use the session object by using:
Session["object_name"];
"object_name" can be whatever you want.

But if you do want to use query strings, use the Server.UrlEncode/Server.UrlDecode methods.

Example:

Change :
Expand|Select|Wrap|Line Numbers
  1. //c# code
  2. //string url = "Client.aspx?FROMDATE=" + text3;
  3. //change to:
  4. string url = "Client.aspx?FROMDATE=" + Server.UrlEncode(text3);
  5.  
And on the other page,
Expand|Select|Wrap|Line Numbers
  1. //c# code
  2. string fromdate = Server.UrlDecode(Request.QueryString["FROMDATE"]);
  3.  
Apr 15 '08 #4
cmrhema
375 256MB
The Session object is a really good idea. You could create a custom class with attributes of all the variables you need to pass with the query string, and then pass an instance of that object. Or, you could pass several strings, and they will be hidden from the user, so it is more hack-proof. You can use the session object by using:
Session["object_name"];
"object_name" can be whatever you want.

But if you do want to use query strings, use the Server.UrlEncode/Server.UrlDecode methods.

Example:

Change :
Expand|Select|Wrap|Line Numbers
  1. //c# code
  2. //string url = "Client.aspx?FROMDATE=" + text3;
  3. //change to:
  4. string url = "Client.aspx?FROMDATE=" + Server.UrlEncode(text3);
  5.  
And on the other page,
Expand|Select|Wrap|Line Numbers
  1. //c# code
  2. string fromdate = Server.UrlDecode(Request.QueryString["FROMDATE"]);
  3.  

Thank you all for your replies
May 20 '08 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

22
by: Robert Brown | last post by:
suppose I have the following table: CREATE TABLE (int level, color varchar, length int, width int, height int) It has the following rows 1, "RED", 8, 10, 12 2, NULL, NULL, NULL, 20...
1
by: neptune | last post by:
At my company customers tend to change contracts in the middle of the month. I need a query that will match 1 customer to 1 contract. If the customer changes contracts before the 15th of the...
2
by: Thomas McK | last post by:
Hi all, I'm trying to make a SQL query (against a table in MS Access) where I want to take the value of something, and check to see if the first two letters in that value are capitalized (for...
6
by: Tony Miller | last post by:
All I have an aggregate query using the function Month & Year on a datereceived field ie: TheYear: Year() TheMonth: Month() These are the group by fields to give me a Count on another field by...
6
by: B. Gandhi | last post by:
Hi friends I have a query regarding memory allocation deallocation in C. It is as follows: char *path = getenv("PATH"); In this call to getenv(), where does the returned string stored?...
8
by: vidya.bhagwath | last post by:
Hello Experts, I am using std::string object as a member variable in one of the my class. The same class member function operates on the std::string object and it appends some string to that...
7
rsrinivasan
by: rsrinivasan | last post by:
Hi, Good Morning To All.. I have doubt in my query.. My Query is, select * from table1,table2, table3.. where table1.field=table2.field and...
16
by: yu_kuo | last post by:
Is there any comparison data on perfomance difference between std::string and c style string? Or maybe if there are source code which could be used to measuer on different compiler/platform, in a...
11
by: julie.siebel | last post by:
I'm working on a rather complex booking system for building European trips, in a combination of SQL/VBScript/Javascript. There are tons of query string variables that get passed back and forth...
5
by: abhilashcashok | last post by:
hi guys, my prblem is that I cannot update sql query against MS ACCESS using C#. Everytime wen i do so, i got an exception (at runtime) as 'UPDATE syntax not correct'. I don find any error in my...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.