|
Hi Navaneeth... that onchange event not making problem, as with that i am able to fire client side properly, also i am bound to use onchange in place of any other as if user use mouse to paste data in textbox directly without using keyboard then my event will not be fired.
what i think navaneeth anyhow what event i am using that is not reason of firing server side event, but the way i am relating my clientside change event to server side... some way is there to bound that returned value from clientside function to stop server side firing but i am not getting how?
please help me if you got how we can do that?
Akhilesh Singh
|
|
|
|
|
akhilesh@slk wrote: that onchange event not making problem
I still feel so.. Try the following
1- Add one textbox and set Autopostback=true
2- Page load add TextBox1.Attributes.Add("OnChange","MyFunction();");
3- Run the page and view source.
4- You will find textbox attribute like onchange="MyFunction();__doPostBack('TextBox1','')"
In this case MyFunction() will be called. But it won't stop if MyFunction() is returning false. So it will call __doPostBack() method which posts data.
akhilesh@slk wrote: bound to use onchange in place of any other as if user use mouse to paste data in textbox directly without using keyboard then my event will not be fired.
I feel it's better to go for KeyDown or KeyUp events. How about checking again on OnClick event ? This event will be fired when user pastes text.
|
|
|
|
|
Navaneeth first of all thanks for suggestion... it is really helpful but i think i am not lucky to use it in my problem. as if user just clicks on textbox without intention of pasting anything, then firing the onclick event is not good.
I think i need to give some more detail about what i am doing. here user will enter some text say "abc123", this is a search key based on this data i have to search mydatabase to get some details, i am using ajax for this. once user will fill textbox and focus goes out of textbox i will call my jscript function "getClient()", which will call a webmethod using ajax and will return a string. if string is not null, then i want to fire TextChanged event (server side), otherwise if string is null, this server event should not be fired. so this is all m trying to do. for this only my "getclient()" function is returning true if string is not null otherwise will return false...
also i am already following your point 1 and 2. i can't do anything which will permanently stop my server side, as i need it once returned string from database is not null.
if i am wrong anywhere please correct me
Akhilesh Singh
|
|
|
|
|
akhilesh@slk wrote: as if user just clicks on textbox without intention of pasting anything, then firing the onclick event is not good.
Yes I know it is not. But you can check textbox is null or not. If it is null then don't call AJAX method.
Sorry I am not getting any other method that could help you. Let me try once and let you know.
|
|
|
|
|
Sorry Navaneeth, i didn't tell you one condition as if already he has type something in textbox and after that he tries to click on textbox then as now textbox is not empty or null, we should not fire our any of onchange event as data is not changed, user just clicked on the textbox... and like this there are situation, we can put logic for this one but again some situation will come, so i am using onchange in place of any other event...
at last i am really thankful to you for replying as i am new to codeproject and didn't expect this much good response. thanks again...
Akhilesh Singh
|
|
|
|
|
when i am seeing source of my page, it is like this for textbox...
hope this can explain somewhat more about the problem.
Akhilesh Singh
|
|
|
|
|
fr33l0ad3r wrote: string classVal = "";
It looks like your variable is private. Declare it as public in the class.
|
|
|
|
|
fr33l0ad3r wrote: Do I have to put it in a class in the code behind page?
Ya I think so.
|
|
|
|
|
Hi,
This post is probably supposed to be in the SQL forum, but it needs to be in the ASP.NET forum as well.
I am using full text searching. When I type in text1 in my title textbox, then my CONTAINSTABLE looks like:
CONTAINSTABLE(tblFullTextSearch, [fldTitle], ' "text1" ')
When I type in text1 text2 then my CONTAINSTABLE looks like:
CONTAINSTABLE(tblFullTextSearch, [fldTitle], ' "text1" AND "text2" ')
But when I type in "text1 text2" then I NEED it to look like:
CONTAINSTABLE(tblFullTextSearch, [fldTitle], ' "text1 text2" ')
I'm not sure how to do this, please can some one help me?
Regards
ma se
|
|
|
|
|
I tested the default functionality of 'Remember Me Next Time' option in login control.
Once if u logged into the app by checking 'Remember Me Next Time' Checkbox, Next time It is working in such a way that it bypasses the authentication. It means when u try to browse same app it will not prompt for user credentials and directly redirecting the user to specific page.
But i want this functionality in such a way that it should show the login page with with login control filled with username and password
can anybody plz let me the solution.
i wrote the code like this
In LoggedIn Event:
CheckBox rm = (CheckBox)Login1.FindControl("RememberMe");
if (rm.Checked)
{
HttpCookie RemMe = new HttpCookie("RemMe");
Response.Cookies.Remove("RemMe");
Response.Cookies.Add(RemMe);
RemMe.Values.Add("UName", this.Login1.UserName.ToString());
RemMe.Values.Add("Pass", this.Login1.Password.ToString());
DateTime dtExpiry = DateTime.Now.AddDays(15);
Response.Cookies["RemMe"].Expires = dtExpiry;
}
and
In PageLoad Event
if (Request.Cookies["RemMe"] != null)
{
HttpCookie RemMe = Request.Cookies.Get("RemMe");
string UName = RemMe.Values["UName"].ToString();
string password = RemMe.Values["Pass"].ToString();
TextBox txtUname = (TextBox)Login1.FindControl("UserName");
TextBox txtPwd = (TextBox)Login1.FindControl("Password");
txtUname.Text = UName;// it is filling the username in username textbox
txtPwd.Text = password;//it is not filling the password in password textbox
}
thank u
cnu
|
|
|
|
|
hi all,
i have a html page on my production server which from where my website runs.I call my asp.net application which is on a remote server using iframe on that html page.
I created p3p policy for the website and p3p policy for the application on the remote server now when i try to validate using
http://www.w3.org/P3P/validator.html[^
then it shows the below
/w3c/p3p.xml does not specify P3P policy for http://remote_server_ip_goes_here/
can anyone tell me whats the issue here is?
Rama Charan Prasad
"Be happy and Keep smiling.Thats what u want be always.. "
|
|
|
|
|
I want validation expression to test special character at starting and ending and also no same special character should be continously two times .
like ##.
I tried a lot but could not suceed. I am getting no error on underscore which is also a special character.
can someone help me out ?
thanks
|
|
|
|
|
Can you show me the expression what you tried ? Have you used back referencing ? I wrote this expression,
([^a-z0-9]+)\1
1- This will match ##,@@...
2- This won't match ###, but will match ####
This will match all special characters that comes together. You can extend this by adding starting and ending characters you want to match.
|
|
|
|
|
i finished up with
^[a-zA-Z0-9]+(\w|(\b[\W]{1}))+[a-zA-Z0-9]$
thanks for the support which i got from my friends
|
|
|
|
|
sure !!
since i finished by your help .
^[a-zA-Z0-9]+(\w|(\b[\W]{1}))+[a-zA-Z0-9]$
but now the thing after vigorous testing i found that it wont work for _
for others it is working .
can you try it out for _.
thanks and regards.
|
|
|
|
|
How to add reference to mpr.lib in ASP.net application
If you have faith in the cause and
the means and in God, the hot
Sun will be cool for you.
|
|
|
|
|
What on earth is mpr.lib ? AFAIK, you can't add a lib file to a .NET app. ASP.NET has nothing to do with it, the .NET part is your problem.
Christian Graus - Microsoft MVP - C++
"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 )
|
|
|
|
|
Christian Graus wrote: What on earth is mpr.lib ?
Yeah. I googled it and found that mpr.lib is using in this control.
this article wrote: Add the mpr.lib library in, to be linked into your application. To do this select 'Project->Settings' to open the project settings dialog. Select the 'Link' tab and from the drop down box select the 'General' category. In the 'Object/Link modules' edit box, type in mpr.lib
but not sure whether this is the one that he is using..
I wonder why VS doesn't allow us to add *.lib?
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you.
|
|
|
|
|
Because a .lib file is the compiled code to go with headers used to include a C++ library.
Christian Graus - Microsoft MVP - C++
"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 )
|
|
|
|
|
Hi friends
I need regular Expression string for single char '-' or values like 12.00 , -12.00 , 124.85 , -154.89 , -5.14 , 5.25 , 5247.25.......
User can add either single char - or values.
Thanks for advance
Pathan
---------------------------------------------------
|
|
|
|
|
Try
\A-\d*\.\d{2}\b|\b\A\d*\.\d{2}$
This will match all in the this pattern -10.00 and 10.00
|
|
|
|
|
Hi navneeth
I have tried all string 12.00 , -12.00 and - but didnt matched.
Please check out
Pathan
---------------------------------------------------
|
|
|
|
|
It is matching 12.00 and -12.00. Do you need any more combinations to be matched ? You are using this in .NET right ?
|
|
|
|
|
Ya. I am working in .net 2.0.
It should be also accept only a single char '-'.
Pathan
---------------------------------------------------
|
|
|
|
|
Imran Khan Pathan wrote: It should be also accept only a single char '-'.
\A-\d*\.\d{2}\b|\b\A\d*\.\d{2}$|\A-{1}$
|
|
|
|