|
Try use Session, instead of ViewState (Or) Pass the textbox Value in URL (Or) PreviousPage.FindControl()
(eg) Session["Value"]=txtbox.Text;
Regards,
Jay
|
|
|
|
|
Yah! I got it.
Thank u
Chandu
|
|
|
|
|
You can use cross page postback to do this in ASP.NET 2.0, otherwise, the viewstate contains only the state of controls that are on that page and have viewstate turned on.
Use the session or the URL to pass stuff between pages otherwise.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
To get a better idear which line in a datagrid will be removed I want to add some data from a gridviewrow to a javascript function
The function is is called CollectData(Person)
{
..... some code
return concatenated_string;
}
In the gridview I want to run the javascript in the OnClientClick event
onClientClick="javascript: return comfirm(CollectData(whatshouldcomehere))"
How can I use the <%#DataBinder.Eval(Container.DataItem, "Person")%> on the whatshouldcomehere spot?
|
|
|
|
|
Hi
1. For calling javascript for an onClick event, you should write code in ItemDataBound event of datagrid as shown below:
private void DataGrid1_ItemDataBound(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e)<br />
{<br />
String strJavascript = "";<br />
strJavascript = "alert('" + e.Item.Cells[0].Text.ToString() + "')";<br />
e.Item.Attributes.Add("Onclick",strJavascript);<br />
}
2. If your bound column 'Person' is at column 2 in the datagrid, then pass e.Item.Cells[1].Text.ToString() as an index starts from 0.
Hope you got it.
Harini
|
|
|
|
|
Thank you. This works nice.
|
|
|
|
|
Hi we can get the values in textbox using textbox.text...,
But same if its in checkbox how to store the value?,
Means if its in checked condition want to store 1 like...,
If its not checked want to store 0 like,
How to do that...,
All sorrows will be forget...,When u think ur most lovable one...,
Mag,
|
|
|
|
|
Hi
CheckboxFieldName.Checked will give true if it is checked otherwise false.
Harini
|
|
|
|
|
No actually i am asking is some thing differ...,
See we can get the values from textbox using textbox.text..,
Using this we can store the values to our table...,
Like that,if checkbox is checked condition,
then want to send 1 value to table...,
Otherwise 0 wnt to send...,
Here i can say if check box is in checked condition i can send flag...,
But i need with out using any flag, we can send the value to our table?,
All sorrows will be forget...,When u think ur most lovable one...,
Mag,
|
|
|
|
|
Hi
Ok then try this
Response.Write(CheckBox1.Checked == true ? "1" : "0");
Harini
|
|
|
|
|
You can implement in this way.....
int value;
if(chkBox_Name.checked == true)
{
value=1;
}
else
{
value=0;
}
Cheers
Chandu
|
|
|
|
|
hi friends
I have three dropdownlist
1.date
2.month
3.year
using <asp:listiltem>i give the date,month,year value in Html
i want to all three store database column DATEOFBIRTH like this(1/1/2007)
can u help me
regards
saravanan
|
|
|
|
|
Hi,
You can use the below user defined function to convert your inputs into DateTime object.
Here, _ex = AM/PM.
public DateTime DateTimeConvertor(string _date, string _hrs, string _min, string _ex)
{
StringBuilder strDateTime=new StringBuilder();
DateTime dt = new DateTime();
strDateTime.Append(_date).Append(" ").Append(_hrs).Append(":").Append(_min).Append(":").Append("00").Append(" ").Append(_ex);
dt = Convert.ToDateTime(strDateTime.ToString());
return dt;
}
Regards,
Jay
|
|
|
|
|
In fact you just need to concat values from three dropdownlist to form a correct date. Is it all about your question...?
|
|
|
|
|
You can write the CommandString like this.....
"INSERT INTO <table_name> (.....,DATEOFBIRTH,.....) VALUES (.....,'"+ddlDate.SelectedItem.Text+"'/'"+ddlMonth.SelectedItem.Text+"'/'"+ddlYear.SelectedItem.Text+"',.....)
ddlDate,ddlMonth,ddlYear are the DropDownList names of the Date,Month,Year resp.
Cheers
Chandu
|
|
|
|
|
Dear All,
I have a problem with a web project i created on VS 2005
I am trying to access it from another computer but it doesn't work, from the same computer it was created on it works fine
I don't have much experience with 2005 projects setup but in 2003 i just used to create the virtual directory in the ISS and call:
http://ComputerName/WebsiteName/Path and all runs fine
On 2005 even if i create a virtual directory for the project i can't access it from outside
Is it related to the ports? And what's the solution?
Thanx in advance
Best Regards
3ala2
|
|
|
|
|
try:
http://IP address/WebsiteName
|
|
|
|
|
it works but the login button doesn't do anything
if i run it from the visual studio the login button enters the code!!!
Best Regards
3ala2
|
|
|
|
|
You run it from localhost computer
http://localhost/WebSiteName or http://127.0.0.1/WebSiteName
|
|
|
|
|
i did that and the problem is that it doesn't execute the login event!
it only fires it if i run it from visual studio 2005
Best Regards
3ala2
|
|
|
|
|
First,you should published your project to local computer.It is a directory .
Next,you add a virtual directory to local compter IIS,it's path refer to the directory.
Try it on!
|
|
|
|
|
When you print a web page (any web page not
necessarily an ASP.Net page) you will see “Page X of
Y” on the top right hand corner, URL of the page on
the bottom left hand corner, and Printed date on the
bottom right hand corner. How can I change these?
Where can I find and alter the code of these?
Basically I want a logo on the top left hand corner,
printed date on the bottom left hand corner, “Page X
of Y” on the bottom right hand corner, and a
label/text on the bottom center.
plz help me...
Pradeep Reddy
|
|
|
|
|
In IE - File, Page Setup - or IE7 drop down the printer menu and select Page Setup there.
You will have to code your logo into your page though, as you cannot embed a logo in the print settings
Steve Jowett
-------------------------
Sometimes a man who deserves to be looked down upon because he is a fool, is only despised only because he is an 'I.T. Consultant'
|
|
|
|
|
insted of doing...
In IE - File, Page Setup - or IE7 drop down the printer menu and select Page Setup there.
can we do it by writing code?
Pradeep Reddy
|
|
|
|
|