|
That's a JS event. Try OnClientClick which ASP.NET will render as OnClick .
|
|
|
|
|
Well, actually, as onclick. And, the big difference is that if you use OnClientClick, you need to return a bool, returning false mean the OnClick is never called.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
|
Better use JavaScript for this ......
In RowDataBind event of Grid in Code Behind
Add the Attribute for the Textbox to call a JavaScript function in
OnFocus event of the textBox and pass parameter as "this.ID"
In JavaScript when u get the ID of TextBox of a paricular row ,u can easily retrieve id of Checkbox ,
Use that Id to check or Uncheck the checkbox
|
|
|
|
|
thanx for the response.
the textbox do not show any onfocus event can you plz give me some code of example.
|
|
|
|
|
|
Hai all,
How to fetch the date using calendar control??
Im not using the scripting..
Help me..
|
|
|
|
|
Are you using the build in calendar control, or a third party one ? What do you mean by 'fetch the date' ? I assume you're saying you're not using any javascript ? If you can be clear, perhaps we can help.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Im just a beginner.. im using the build in ctrl.If i select the date frm ctrl It would be displayed in the text box.. And also the page is refreshed when i select the date and the contents are vanished wat to do...
Help me..
|
|
|
|
|
The built in one totally sucks, but there are examples on MSDN if you want to know how to use it. I took one look at it and decided it was crap, I have never used it.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
|
What are the best approaches to generate random password for User ?
Is their any class available in .net 2.0 ?
which approach would be best ? and proffessional way to do this?
please direct me in right direction .
Best Regards
Rameez
|
|
|
|
|
Oh, I see. You're retarded. I'm sorry about that. Get one of your minders, the ones who help you go to the toilet, to read the answer I gave you last time and explain it to you. There is no other answer. There's no class available, and no other way to do it.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Thank you very much for good answer .
iam new to .net thatswhy i want to confirm from those who has idea of that. else thanks for answering .
Again thanks
best regards
Rameez
|
|
|
|
|
If you're new to .NET, why are you writing a password system for someone ? Oh, because you're cheap.
I don't mind that outsourcing happens, but I am offended at how many completely unqualified people are taking part in it.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
You can use Guid to generate random password. Find it on msdn...
|
|
|
|
|
I don't know what is Best, but i can suggest you one which may help you
Random objRan = new Random();
int ran1 = objRan.Next(10000000,99999999);
int ran2 = objRan.Next(1000, 9999);
string strRandom = ran1.ToString() + ran2.ToString() + DateTime.Now.Millisecond.ToString();
you can try this or can even generate your own algo for same.
I think it will assist you to generate a Random number everytime
|
|
|
|
|
Thanks for reply
what about Guid (Global Unique ID) class may i use this for genrating random Password.?
OR
i will use Random object for creating random password ?
which one approach is best ?
Best Regards
Rmaeez
|
|
|
|
|
|
Hello
I have been trying to debug a problem with a web app that I am responsible for and have traced it down to a very specific problem. To demonstrate that problem, I have written a little web app, and I'm sure someone here can direct me quickly to the source of the problem.
Try
Me.Label1.Text = ""
Me.Label1.Text = Date.Parse(Me.TextBox1.Text).ToShortDateString
Catch ex As Exception
Me.Label1.Text = ex.Message
End Try
When I run this on serverA it with the input of '7/30/2007' it fails with the exception message being: 'String was not recognized as a valid DateTime'
When I run it on any other server, it works fine.
On serverA, if I input '30/1/2007' it works. If I input that value on any of my other servers it fails with 'String was not recognized as a valid DateTime'
The question is, what server configuration value do I need to change on the server to make that server behave the same as the other servers.
These are all windows server 2003 servers, and I checked the regional settings in Control panel and the failing and passing servers have the same regional settings values (english US) and the same long/short date format in the regional settings. Apparently that does not affect this date.parse behavior.
This kind of problem scares me because it introduces a significant likelihood of wierd flaky problems and behavior. If the date value had been '2/5/2007' it would've worked on both servers and it would have been hard to identify why all the data was messed up.
Any help or guidance would be appreciated.
|
|
|
|
|
This is asked so often. The regional settings are obviously different, no matter what you think, and either way, apart from the terrible naming conventions, no production code should ever use Date.Parse, that's what Date.TryParse is for. I wouldn't actually sack someone for writing this code, but there's quite a number of htings I'd be having a talk to them about.
You will always face this issue - if you're moving dates from strings, you risk getting the wrong dates unless you can be sure of the setup on the server. Either way, it's best avoided. I'm all for using a 17 Feb 1969 format, as it's unambiguous.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
I love pompous know-it-all responses that don't answer the question.
Christian, it seemed pretty obvious that the code was written for purposes of demonstrating the problem and was not supposed to be "production code". Feel free to spend as much time as you'd like refactoring it and bringing it up to your standard.
I did some additional reading, and found this very helpful knowledge base article about stabilizing culture specific behavior in asp.net apps - if anyone else has a similar question in the future..
http://support.microsoft.com/kb/326943[^]
|
|
|
|
|
Hello,
I am reading a CSV file into the memory using a streamreader object. I was wondering if there's a way to skip every other line.
ABCD........ (read it)
EFGH........ (skip it)
Here's how I'm reading the csv file:
Command.Parameters.Add("@FirstName", SqlDbType.Nvarchar);
Command.Parameters.Add("@LocationCode", SqlDbType.Float);\
Command.Parameters.Add("@Zip", SqlDbType.Float);
for (int i = 0; i < 11; i ++)
{
while ((line = sr.ReadLine()) != null)
{
string[] col = line.Split(',');
cmd.Parameters["@FirstName"].Value = col[i];
cmd.Parameters["@LocationCode"].Value = col[i + 1];
.
.
cmd.Parameters["@Zip"].Value = col[i + 10];
cmd.ExecuteNonQuery();
}
} Thanks
Tina
|
|
|
|
|
You want to execute code in this way:
ABCD........ (read it)
EFGH........ (skip it)
IJKL.........(read it)
MNOP.........(skip it)
and so on?
Do you want to execute code inside while loop in every odd case?
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
|
|
|
|
|
Hello there, thanks for the speedy response. Sorry couldn’t write back sooner. Yes I do want to skip every other line….chances are its going to be the odd line every single time, however as I said the data is pretty out of whack, so if they decided to add another line before we receive it…it may switch to even.
Is there a way to do code it in a way to skip either one (even or odd line) depending on my data coming in?
Thanks
Tina
|
|
|
|