|
I am looking for a code in javascript which does not allow decimal values in the Telephone No. field(i.e textbox)
Thanks & regards,
Suresh Dayma
Everything Is Possible!
|
|
|
|
|
function KeyCheck(myfield,e)
{
var keycode;
if (window.event) keycode = window.event.keyCode;
else if (e) keycode = e.which;
else return true;
if (((keycode>47) && (keycode<58) ) || (keycode==8)) { return true; }
else return false;
}
You can use this function for keypress so that it will not allow u to put any characters but only numeric.
If you have a HTML control then call this function by onkeypress="return KeyCheck(this,event);"
Else on server side code write TxtPhone.Attributes.Add("onkeypress","return KeyCheck(this,event)");
Vicky
"Walking on water and developing Software on a specification is easy, if
both are frozen..."
|
|
|
|
|
Thanks for your help....
Thanks & regards,
Suresh Dayma
Everything Is Possible!
|
|
|
|
|
how can i create a session in asp.net2005 using c#
dcjoshi2
|
|
|
|
|
Every time an user open your site on a browser window, it create a session automatically
Create a session variable with the user Id
string userId = (to consult the database)....
Session["userId"] = userId;
Check the session State
string stateSession = Session.Mode.ToString();
write these lines on all onload process pages in order to check if the session dont time out
<br />
try<br />
{<br />
string isAlive = Session["userId"].ToString();<br />
}<br />
catch(Exception)
{<br />
Response.Redirect("error.aspx");
}<br />
Ojala sea lo que buscas
i hope it was what you looking for
keep Learning and you never will be out of date...
|
|
|
|
|
hi
can any one give me the code for deletecommand event of the asp.net datagrid. iam displaying data from sqlserver.when i clicked the delete link of a particular row.that record should be deleted.
thanks
vijay
|
|
|
|
|
you know, Its a basic cuestion, everyone who developed a website has working that
but dont worry let me help you
delete Command using Sql query
<br />
private void DataGrid_DeleteCommand(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e)<br />
{<br />
string userId = DataGrid.DataKeys[e.Item.ItemIndex].ToString();<br />
string query = "DELETE FROM users WHERE Id = '" + userId + "'";<br />
SqlCommand commandSql = new SqlCommand(query, conection);<br />
vG.conexion.Open();<br />
comandoSql.ExecuteNonQuery();<br />
vG.conexion.Close();<br />
}<br />
using dataSet synchronization
<br />
<br />
private void DataGrid_DeleteCommand(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e)<br />
{<br />
DataSet dS = new DataSet();<br />
SqlDataAdapter dA = new SqlDataAdapter();<br />
string query = "SELECT * FROM users";<br />
SqlCommand commandSql = new SqlCommand(query, conection);<br />
dA.SelectCommand = comandSql;<br />
dA.Fill(dS);<br />
SqlCommandBuilder sCB = new SqlCommandBuilder(dA);<br />
dS.Tables[0].Rows[e.Item.ItemIndex].Delete();<br />
dA.Update(dS);<br />
Response.Redirect("Usuario_delete_ok.aspx");<br />
}<br />
keep Learning and you never will be out of date...
|
|
|
|
|
Is this for an exam that you should have studied for?
---
b { font-weight: normal; }
|
|
|
|
|
|
No more silly than your subject line and 1 line question (which can be answered using some simple searching)
|
|
|
|
|
r u an student or an developer.
With Regards
Satips
|
|
|
|
|
hai,
i am having a serious problem of session expiry in the remote server.
i am using asp.net +vb.net
i hav set the session expiry as 75min in the web.config but is getting only
15min.
How could i increase the session timeout at the remote server
plz reply ASAP
Nithin
|
|
|
|
|
have you tried timeOut in Web.config
|
|
|
|
|
i hav tried that but its not working
Nithin
|
|
|
|
|
hi,
i have several DDL in my page if i choose one item from a dropdownlist1 list then the relevant items are populated to the second dropdownlist2 list.
what my problem is according to some condition i have choosed values for some of the dropdownlist1,so that relevant dropdownlist 2 DDL should have list.
i done this with Ajax abd asp.
but when i choose the values for DDL1 list onload then he values are not coming for all the DDL only im getting for the last box.
all other box ready state not getting into 4.
someone please help about this issue.
with regards,
susa
|
|
|
|
|
Hi everybody ,
Can anybody tell me , how to find printer status in aspx page ? using VB language .Is there any method/event or inbuilt library to check it on web-page?
Thanking you.
param
param
|
|
|
|
|
Hi,
There is a rule/checkpoint in Accessibility which says that a Web page should work even when Javascript is disabled.
Currently the MouseOver effect functionality in a Web page is achieved by using "onMouseOver && onMouseOut" in javascript. Is there a way in which MouseOver && MouseOut functionality can be provided without using Javascript?
Please let me know.
Thanks in advance
Narendra
|
|
|
|
|
What does the mouseover/mouseout achieve?
If it is merely changing colors/layout then you could use CSS with a "hover" selector.
If it is context-help, then you could make links beside every rollover place where the user could get the same information.
Kind regards - Jakob
*********************************************
Three kinds of people in the world:
- Those who can count..
- Those who can't!
10 kinds of people in the world:
- Those who understand binary
- Those who don't
|
|
|
|
|
Hi,
There is a rule/checkpoint in Accessibility which says that a Web page should work even when Javascript is disabled.
Currently the Close functionality in a Web page is achieved by using "Window.Close()" in javascript. Is there a way in which Close functionality can be provided without uing Javascript? (other than using Close available in File Menu)
Please let me know.
Thanks in advance
Narendra
|
|
|
|
|
whn i update a row in database thru asp.net2005 web page thn the data update successfully but whn i click after tht updation in "Refresh" button into Internet explorer thn tht particular row update again.so how can i prevent this situtation.
-- modified at 4:50 Thursday 21st September, 2006
dcjoshi2
|
|
|
|
|
Hi,
so what u basically need is to detect a page refresh and avoid the subsequent update. Refer this link- http://www.codeproject.com/aspnet/Detecting_Refresh.asp
hope this helps you.
"If A is success in life, then A equals x plus y plus z. Work is x; y is play; and z is keeping your mouth shut." - Albert Einstein
|
|
|
|
|
there are three solutions
first one
use the negation ispostback command at load page
if(!IsPostBack)
{
update()
}
Second one
open a new page when the update process is already done
update()
response.redirect("update_ok.aspx",true);
third one
open your site onto a browser page whitout browsers bars, use a javascript function
keep Learning and you never will be out of date...
|
|
|
|
|
Hi,
I am experienced in C#, but new in ASP.NET. I cannot understand Web page life cycle. If I understand correctly, Web page class is destroyed every time you press the button or something. So I store my properties in ViewState. but there is a problem. I use TextBox to get keyword, which I use for database records retrieval. When i retrieve database records I add dynamically new rows to table with hrefs.
private void LoadData()
{
baseTechPartArray mParts = DataBase3.Get_baseTechPartArray_By_Keyword(KeyWord);
for (int i = 0; i <= mParts.Count - 1; i++)
{
TableRow mRow = new TableRow();
TableCell cellPickup = new TableCell();
TableCell cellName = new TableCell();
TableCell cellCode = new TableCell();
mRow.Cells.Add(cellPickup);
mRow.Cells.Add(cellName);
mRow.Cells.Add(cellCode);
ContainerTable.Rows.Add(mRow);
LinkButton hrefName = new LinkButton();
hrefName.Text = mParts.Get(i).name;
hrefName.Attributes["record_id"] = mParts.Get(i).id.ToString();
LinkButton hrefCode = new LinkButton();
hrefCode.Text = mParts.Get(i).code;
hrefCode.Attributes["record_id"] = mParts.Get(i).id.ToString();
ImageButton mPickupButton = new ImageButton();
mPickupButton.BorderWidth = 0;
mPickupButton.ImageUrl = "../Resources/pickup.gif";
mPickupButton.Attributes["record_id"] = mParts.Get(i).id.ToString();
cellPickup.Controls.Add(mPickupButton);
cellName.Controls.Add(hrefName);
cellCode.Controls.Add(hrefCode);
mPickupButton.Click += new ImageClickEventHandler(mPickupButton_Click);
hrefCode.Click += new EventHandler(hrefCode_Click);
hrefName.Click += new EventHandler(hrefName_Click);
cellPickup.Attributes["width"] = "1%";
cellCode.Attributes["width"] = "30%";
}
}
but Click events does not work until I add Load() method to PageLoad or LoadViewState.
But then some of table rows are still from first page load, I try to clear them, but it does`nt help. What simple framework or principle should I use 1)to get work simple onevent -> 2)add dynamic elements with their events -> 3)use dynamically added control events?
|
|
|
|
|
Can you tell me what is the problem, without elaboration.
|
|
|
|
|
The problem is, that everything show up good, but click events does`nt work. When I click on dynamically added hyperlinks, hyperlink click event does`nt run, but page reloads and everything is gone.
|
|
|
|