|
Hi kashif,
I already seen it, it's good but not having features as table or images.
Thanks,
|
|
|
|
|
|
|
|
Hi all i want to disable the Refresh button
i just addeded javascript function for F5. and it works fine
here is my code works fine for F5
"function refresh()"+
"{"+
"if (116==event.keyCode)"+
"{"+
"event.cancelBubble = true;" +
"event.returnValue = false;" +
"event.keyCode = 0;" +
"return false;" +
"}"+
"}"+
"document.onkeydown = function (){ refresh(); } ");
but i cant diable the icon shown in tool bar for Refresh
can some one help me
thanks in advance
|
|
|
|
|
Try This..!
<Script language="javascript">
function checkKeyCode(evt)
{
var evt = (evt) ? evt : ((event) ? event : null);
var node = (evt.target) ? evt.target : ((evt.srcElement) ? evt.srcElement : null);
if(event.keyCode==116)
{
evt.keyCode=0;
return false
}
}
document.onkeydown=checkKeyCode;
</script>
LatestArticle :Log4Net
Why Do Some People Forget To Mark as Answer .If It Helps.
|
|
|
|
|
Controlling browser buttons is an idiotic idea. Actually you cant do it with 100% perfection.
|
|
|
|
|
jasome wrote: but i cant diable the icon shown in tool bar for Refresh
Actually you can't.
Only thing that you can do(what most banking site does) is you can open this in a new window with no toolbar. Thus the Refresh button never appears.
And you just remove the refresh facility from browser and you are done.
You should also remove the Right click context menu.
You might look into this to disable right click in browser:
http://www.codeproject.com/tips/42554/Javascript-hack-to-disable-Right-Click-and-Text-Se.aspx[^]
Cheers
|
|
|
|
|
Hi All,
i am logging into the application using login id and password. after varifying from the data base.
requirment is only u can log in only at one place using login id and password u can not login to another machine using same login id and password.
This thing i can do after adding one more field into the database setting value to true or false.
But what if power goes off where will i set value to false.
Thanks and regards,
Amit Patel
|
|
|
|
|
Have a look at global.asax application start event.
|
|
|
|
|
You can clear the Flag at Session_End event. As Session maintained on server side, and whenever session end called set the database flag to false. So you do not need to worries about it.
One more thing you need to, you need to also check browser close.
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
Hi All,
How to set flag when user cloase the brower .
Thanks and regards,
Amit Patel
|
|
|
|
|
|
how to use rollback mysql database in asp.net.
public void RunTransaction(string myConnString)
{
MySqlConnection myConnection = new MySqlConnection(myConnString);
myConnection.Open();
MySqlCommand myCommand = myConnection.CreateCommand();
MySqlTransaction myTrans;
myTrans = myConnection.BeginTransaction();
myCommand.Connection = myConnection;
myCommand.Transaction = myTrans;
try
{
myCommand.CommandText = "insert into Test (id, desc) VALUES (100, 'Description')";
myCommand.ExecuteNonQuery();
myCommand.CommandText = "insert into Test (id, desc) VALUES (101, 'Description')";
myCommand.ExecuteNonQuery();
myTrans.Commit();
Console.WriteLine("Both records are written to database.");
}
catch(Exception e)
{
try
{
myTrans.Rollback();
}
catch (SqlException ex)
{
if (myTrans.Connection != null)
{
Console.WriteLine("An exception of type " + ex.GetType() +
" was encountered while attempting to roll back the transaction.");
}
}
Console.WriteLine("An exception of type " + e.GetType() +
" was encountered while inserting the data.");
Console.WriteLine("Neither record was written to database.");
}
finally
{
myConnection.Close();
}
} this code is not workin
http://dev.mysql.com/doc/refman/5.0/es/connector-net-examples-mysqlconnection.html#connector-net-examples-mysqlconnection-begintransaction1
plz help....
|
|
|
|
|
Hi ,
is it giving any error to u??
Thanks ,
amit
|
|
|
|
|
it went to catch for rollback but my database got updated.
|
|
|
|
|
bhavnvyas wrote: it went to catch for rollback but my database got updated.
If it go to Exception ,then only the transaction will fails..!
LatestArticle :Log4Net
Why Do Some People Forget To Mark as Answer .If It Helps.
|
|
|
|
|
bhavnvyas wrote: this code is not workin
Try this One..!
http://www.codeproject.com/KB/database/transactions.aspx
|
|
|
|
|
but i am using mysql
its not going in my catch for rollback....
|
|
|
|
|
Great ..! Then the Query may change ..!
I dont know much abt mysql..! Check tht it supports with this code..!
LatestArticle :Log4Net
Why Do Some People Forget To Mark as Answer .If It Helps.
|
|
|
|
|
|
Dont get Too Confuse..!
Ask the same question to the author who wrote the article..!He May Help You..!
LatestArticle :Log4Net
Why Do Some People Forget To Mark as Answer .If It Helps.
|
|
|
|
|
|
With Eval function, i am able to parse JSON string in IE and Chrome. But i am not able to parse json string using Eval function in Firefox. Can you please give the code to solve this problem.
|
|
|
|
|
Are you parsing JSON in client?
What error you are getting. Can you show the JSON string ?
Are you doing like this
var jsonOBJ = eval('(' + data + ')');
I think it works in Firefox as well..
|
|
|
|