|
i think its better to keep in a hidden fiel value
|
|
|
|
|
A hidden field can be something similar to the input element as suggested in the example below ?
<br />
<script runat="server"><br />
public void Page_Load(Object sender, EventArgs e)<br />
{<br />
String csname2 = "ButtonClickScript";<br />
Type cstype = this.GetType();<br />
<br />
ClientScriptManager cs = Page.ClientScript;<br />
<br />
if (!cs.IsClientScriptBlockRegistered(cstype, csname2))<br />
{<br />
StringBuilder cstext2 = new StringBuilder();<br />
cstext2.Append("<script type=\"text/javascript\"> function DoClick() {");<br />
cstext2.Append("var oElement = document.all.Panel1; Form1.Message.value= oElement.offsetLeft;} </");<br />
cstext2.Append("script>");<br />
cs.RegisterClientScriptBlock(cstype, csname2, cstext2.ToString(), false);<br />
}<br />
}<br />
</script><br />
<html ><br />
<head><br />
<title>ClientScriptManager Example</title><br />
</head><br />
<body><br />
<form id="Form1"<br />
runat="server"><br />
<input type="text" id="Message" /> <br />
<input type="button" value="ClickMe" onclick="DoClick()" /><br />
<asp:Panel ID="Panel1" runat="server" style="position:absolute;top: 375px;left: 628px;height: 422px;width: 513px; border-color:Red;border-width:thick;border-style:solid"></asp:Panel><br />
</form><br />
</body><br />
</html><br />
edit: Example is based from MSDN article http://msdn2.microsoft.com/en-us/library/z9h4dk8y.aspx[^]
edit: sorry I worked out what a hidden field is thanks to google
http://msdn2.microsoft.com/en-us/library/system.web.ui.htmlcontrols.htmlinputhidden(VS.71).aspx[^]
modified on Thursday, December 06, 2007 8:33:21 AM
|
|
|
|
|
hi friends
i will type any text in textbox. and chose any language that text will converted in that language example like englisg to french..
how to convert text like this anyone help me..........
|
|
|
|
|
1. The pros of "GetLocalResourceObject" and "GetGlobalResourceObject" is to help you achieve
Gloabalization and Localization easily. Cons is that writing code is a little complex than usual.
2. You can use Xml file instead of Resources, as resource itself is in xml format. I would not
suggest you use xml files, because you will lose the ability of using the build-in resource
Localization/Globalization support.
3. The captions of controls should also be get from the resource file.
4. Since .NET 3.5 hasn't been released yet, I do not know whether it will have any new feature on
this.
You can take a look at the following links for more information
http://msdn2.microsoft.com/en-us/library/ms227982.aspx[^]
http://msdn2.microsoft.com/en-us/library/c6zyy3s9.aspx[^]
SSK.
Anyone who says sunshine brings happiness has never danced in the rain.
|
|
|
|
|
You need to have the translation service for that. so, you may develop your own one or you can use the third-party translation web services....
|
|
|
|
|
hi everyone,
I have 4 DropDownList controls which are used to take the starting time and ending time of a business. I only take hours and minutes for the Starting time.
Now I want to put some client side validation so that the starting time is less than the ending time. I'm using 24 hour notation so AM/PM is not an issue.
How can i make use of Javascript here. plz give me some idea/guidance/code sample(if any)
Thanks in advance
Rocky
You can't climb up a ladder with your hands in your pockets.
|
|
|
|
|
You can add javascript like DropDownList.Attributes.Add("OnClick","YourJS()");. Onclick is the event and can be anything applicable to dropdownlist.
|
|
|
|
|
Hello Friends,
I'm opening a small window
window.open("Default2.aspx",'','width=400,height=400,srollbars=1');
and it is opening a small window in Internet Explorer but not in Mozilla
but in Mozilla it's opening the window in a new tab but i want to open in a small window as i've described above
|
|
|
|
|
Is your Mozilla browser the latest version??
If yes then you can try this page in Mozilla.. then, click "open popup" link and see whether you got new window or not..
http://www.quirksmode.org/js/popup.html[^]
|
|
|
|
|
Hello Michael,
I've opened that url in Mozilla and clicked on "open popup" but it did not open a new window but being opened in a new tab in Mozilla but running great in IE.........
Now can u let me know why it's happening
|
|
|
|
|
which version of Mozilla are you using? I will try on my machine.. i think there might be some configs to do that
|
|
|
|
|
how i can get a select statment results form a stored procedures ie select statement returns a multi set values how this can be retrived
|
|
|
|
|
how can i add child grid in to Parent Grid view and populate it
wasim khan
|
|
|
|
|
I have a TextBox in which Date Of Birth is entered...How can i calculate the AGE...Any idea is helpfull.
Thanks in Advance...
Erasers are for people who are willing to correct their mistakes.
|
|
|
|
|
Just store the DOB from the text box and use this
it would be simpler for you to calculate age in your database server
like
SELECT DATEDIFF(year, yourbirthdayfield, GETDATE()) AS Age
FROM YourTable
this will return the a field in your query that has the age.
SSK.
Anyone who says sunshine brings happiness has never danced in the rain.
|
|
|
|
|
Why simpler in database? It's pretty much the same in .net code?
|
|
|
|
|
Ok Thanks Paddy Boyd.
SSK.
Anyone who says sunshine brings happiness has never danced in the rain.
|
|
|
|
|
Vri SSK wrote: SELECT DATEDIFF(year, yourbirthdayfield, GETDATE()) AS Age
Common mistake (I've made it myself).
Today is 6 Dec 2007. If my birthdate is 5 December 1997 this returns my age as 10. If my birthday is 7 Dec 1997 this also returns my birthdate as 10.
<br />
DECLARE @myBirthday1 DATETIME<br />
DECLARE @myBirthday2 DATETIME<br />
<br />
SET @myBirthday1 = '5 dec 1997'<br />
SET @myBirthday2 = '7 dec 1997'<br />
<br />
SELECT DATEDIFF(year, @myBirthday1, GETDATE())<br />
SELECT DATEDIFF(year, @myBirthday2, GETDATE())<br />
result:
10
10
FYI the correct way to calculate this is not quite so simple (unfortunately)
<br />
(case when dateadd(year,datediff(year,[birthdate],getutcdate()),[birthdate])>getutcdate() then datediff(year,[birthdate],getutcdate())-(1) else datediff(year,[birthdate],getutcdate()) end)<br />
|
|
|
|
|
1) Parse the Text from the textbox into a DateTime .
2) Find the difference between that date and the current date in years.
|
|
|
|
|
Hi All,
Please help me how to proceed from this situation, my requirement is to present (load) data in excel file and need to access (update/delete) it, the data which is in remote server; I want to connect database using odbc connection through ASP.NET. Please suggest me how to continue.
Thanks to all in Advance.
kolags@hotmail.com
|
|
|
|
|
Hi,
I had one datagrid,i need to delete one record on condition...the condition is like If the date is less than the System date,then i can do it,other wise i need to show message like 'Unable to Delete Record'.
Vasvai
|
|
|
|
|
Use Javascript for that with Date validation and check the date is less than the system date.
SSK.
Anyone who says sunshine brings happiness has never danced in the rain.
|
|
|
|
|
i have a stored procedure with select * from employee where empid is =some id number this statement i wrote in the storedprocedure..now i want the values of the select statement return from a stored procedure.here iam giving the id value through the stored procedure only....
|
|
|
|
|
jagadeeshkumar2106 wrote: have a stored procedure with select * from employee where empid is =some id number this statement i wrote in the storedprocedure..now i want the values of the select statement return from a stored procedure.here iam giving the id value through the stored procedure only....
The fact you use a SELECT "returns" the data. Use ExecuteReader or use a Data Adapter to Fill a DataSet in order to get the data.
|
|
|
|
|
What are you using to read the data with? If your Stored Procedure uses SELECT *, then you should use either ExecuteDataReader fill a DataSet. BTW - it is really bad practice to use SELECT *. You should always explicitly name the columns you want returning.
|
|
|
|