|
I want to pass query string (name & value pair) to another page.
I am setting the query string as
QueryStringParameter q = new QueryStringParameter();
q.Name = "Poll";
q.QueryStringField = "1";
and redirect as
Response.Redirect("Poll.aspx");
What should I do, so that the query string (name & value pair) would become the part the url, and available at the other page ?
Apurv
|
|
|
|
|
Just do this :
Response.Redirect("poll.aspx?"+name+"="+val);
|
|
|
|
|
|
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
//Get fresh data
DataGrid1.DataSource = Test();
//Bind to grid
DataGrid1.DataBind();
}
}
protected DataTable Test()
{
//Create new table object
DataTable dt = new DataTable();
dt.TableName = "Name";
//Create new column object
DataColumn dc = new DataColumn();
//Set the properties for the column
dc.ColumnName("Code");
dc.DataType = System.Type.GetType("System.Int32");
dc.DefaultValue = 0;
//Add new column
dc = new DataColumn("Name", System.Type.GetType("System.String"));
dc.DefaultValue = string.Empty;
dc.Caption = "Name";
dt.Columns.Add(dc);
//Create new row object
DataRow dr = new DataRow();
dr = dt.NewRow();
dr["Code"] = 001;
dr["Name"] = "Tan Teck Wah";
//Add new row
dr = new DataRow();
dr["Code"] = 002;
dr["Name"] = "Joseph Lin";
dt.Rows.Add(dr);
return dt;
}
//Display Data
private string GetTableData(DataTable dt)
{
StringBuilder TableData = new StringBuilder();
// retrieve header row column labels
TableData.AppendFormat("Row");
foreach (DataColumn dc in dt.Columns)
TableData.AppendFormat("\t{0}", dc.ColumnName);
TableData.AppendFormat("\n");
// retrieve rows
int j = -1;
foreach (DataRow dr in dt.Rows)
{
TableData.AppendFormat("[{0}]",++j);
foreach (DataColumn dc in dt.Columns)
{
TableData.AppendFormat("\t{0}", dr[dc] );
}
TableData.AppendFormat("\n");
}
return TableData.ToString();
}
}
there isnt any error when debug, however was unable to display the datagrid during runtime.
|
|
|
|
|
Seems like the DataSource has empty data. Are you sure that your DataTable has rows because I don't see any piece of code which is loading the DataTable with data.
In a DataGrid, if the DataSource is empty, the DataGrid will not show up. Use GridView control with has EmptyRowTemplate which will automatically show up if the DataSource doesn't has values.
|
|
|
|
|
I want to delete the directory which is having two images. So for deleting the directory i'm deleting images first but still after deleting the images my directory showing it's size 42.kb but the directory is having nothing. Due to this problem i cann't delete the directory and it's throwing the error "The directory is not empty"
So now plz tell me how to delete this directory
|
|
|
|
|
You are Deleting file using DOS Command.
So skip it and Delete Folder Using Windows Command.
System.IO.Directory.Delete
Thanks
|
|
|
|
|
i want when i click on button i see an alert with ok button and when i click ok it goes to this url:www.yahoo.com
i wrote this but it has error:
btnAccept.Attributes.Add("OnClick", "input_box=alert(\"saved.\");if (input_box==true){location.replace("http://www.yahoo.com");}");
modified on Sunday, July 13, 2008 6:29 AM
|
|
|
|
|
An alert only has an ok button, so the window.alert method doesn't return anything.
If you want the option to cancel the operation, you use the window.confirm method instead.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
|
|
really.....
why u havent given answer...
|
|
|
|
|
|
|
hi all,
I have a Calculate button that get data from database and store it in a datatable and a RadGrid
after this button executed the datatable and RadGrid become empty(count=0);
how can I solve This problem,,,,,,,
Thanks all person who help meeeeeeeee.
|
|
|
|
|
What are they & How to make one??
I'm not a web developer so please give me a good start.
Thank you guys!
All generalizations are wrong, including this one!
(\ /)
(O.o)
(><)
|
|
|
|
|
Can any one help me with the javascript part
protected void Button1_Click(object sender, EventArgs e)
{
/* The code to send values to database*/
/* AFTER SUCCESSFUL SENDING OF VALUES A JAVASCRIPT ALERT CONFIRMATION WITH OK BUTTON WHEN USER CLICK OK REDIRECT TO HOME.ASPX PAGE */
}
thanks in advance.
|
|
|
|
|
In Page_Init(Object sender, EventArgs e) // just like page_Load
Button1.Attributes.Add("onclick", "return confirm('are you sure?')");
If user chooses yes than code will be executed in Button1_Click, otherwise the code is not executed.
|
|
|
|
|
Hello everybody
I want to save panel as image with its controls in it (label,image ...)
is it possible?
Thanks...
|
|
|
|
|
Member 2486844 wrote: s it possible?
yes.
and the first step is calling Control.DrawToBitmap()
modified on Tuesday, July 15, 2008 1:37 PM
|
|
|
|
|
thanks for your reply but i want to do this in a web page and there is no property like 'DrawToBitmap()' for panel in asp.net?
|
|
|
|
|
did you have resolved your problem? can you share your code? I have the problem too.
|
|
|
|
|
My question is how i can upload a file which has size more than 4MB with the FileUplaod control of asp.net.
I can able to upload file less than 4MB but more than 4MB i can not upload. For that which type of changes i have to made in my code or property.
pls, give me proper answer.
|
|
|
|
|
Add this to the web.config
<System.Web>
<httpRuntime maxRequestLength="10000" />
</System.Web>
The number “10000” is in Kilobytes so this would give u 10 MB. U can change it to any file size u want
Hope this would help
Best Regards
3ala2
|
|
|
|
|
Is it possible to invoke a image1_button click from the ASPX (html) file?
<img alt="Submit" src="Images/submitOff.jpg" style="width: 69px; height: 20px" name="SubmitButton" onmouseover="chgImage('SubmitButton','Images/submitOn.jpg')">
onmouseout="chgImage('SubmitButton','Images/submitOff.jpg')"
onclick="<%# %> />
</img>
|
|
|
|