|
Hi all. I have a problem auto-tabbing.
I need the text boxes on my form to auto-tab to the next textbox when they're full. I can do this using JavaScript and input controls, but unfortunately, I need to get at the contents of the text boxes using the code behind page. (And I can not for the life of me figure out how to call javascript from an asp:textbox control.)
Does anyone have any suggestions of examples on how to do this? (I couldn't find anything that worked with google :/ )
- Munty
|
|
|
|
|
try this
code behind function
public static void SetFocus(Control control)<br />
{<br />
StringBuilder sb = new StringBuilder();<br />
<br />
sb.Append("\r\n<script language='JavaScript'>\r\n");<br />
sb.Append("<!--\r\n"); <br />
sb.Append("function SetFocus()\r\n"); <br />
sb.Append("{\r\n"); <br />
sb.Append("\tdocument.");<br />
<br />
Control p = control.Parent;<br />
while (!(p is System.Web.UI.HtmlControls.HtmlForm)) p = p.Parent; <br />
<br />
sb.Append(p.ClientID);<br />
sb.Append("['"); <br />
sb.Append(control.UniqueID); <br />
sb.Append("'].focus();\r\n"); <br />
sb.Append("}\r\n"); <br />
sb.Append("window.onload = SetFocus;\r\n"); <br />
sb.Append("// -->\r\n"); <br />
sb.Append("</script>");<br />
<br />
control.Page.RegisterClientScriptBlock("SetFocus", sb.ToString());<br />
}
write this code in html view
<script language='JavaScript'><br />
<!--<br />
function SetFocus()<br />
{<br />
document.Form1['TextBox1'].focus();<br />
}<br />
window.onload = SetFocus;<br />
</script>
write this code at code behind
PageUtility.SetFocus(TextBox1);
regards
GV Ramana
|
|
|
|
|
I'm using VB as the code behind language
there is no PageUtility function either. :/
For now im sticking with the tags, as I can get auto tabing to work.
My next problem is getting the tags to clear after the page has loaded. (I can't do it on submit because that will clear all of the form, which I don't want. And i cant have a seperate form, because ASP only allows me one form that can run at the server.
help!
- Munty
|
|
|
|
|
hai all,
how to avoid page refreshing in aspx page. when i select the value in drop down list the page refreshed..In that time i have manipulate with database..So it wil take much time for loading... How can avoid this problem... i have develop my project using c# with asp.net
Thanks®ards,
vidyasankar N
pain gives gain
|
|
|
|
|
set its AutoPostBack property to false
regards
GV Ramana
|
|
|
|
|
Hi VidyaSankar...
The postback issue can be overcome if u use AJAX concept in ur application
Regards,
Balaguru
|
|
|
|
|
how to use ajax in particular asp.net webcontrol... you know any sample code... pls send me...
thanks®ards,
vidyasankar N
pain gives gain
|
|
|
|
|
Hi Sankar..
There are many ways in using Ajax..I use a .dll to work with ajax..AS like Ramana said capture the dropdownlist events with javascript and that works fine,but the thing is that u have to go for functions sacrificing the dropdownlist_selectedIndex changed property..
Regards,
Balaguru
|
|
|
|
|
if u dont want to use AJAX then
capture dropdownlist event in javascript & by using javascript manipulate the DB.
regards
GV Ramana
|
|
|
|
|
|
i think you can use html control and fill the drop down when page loads.
this will load the datas when page loads and minimize loading time.
|
|
|
|
|
difference between interface and abstract class
|
|
|
|
|
use google
regards
GV Ramana
|
|
|
|
|
main diff..
Interface-all the methods should be a abstract...
abstractclass-it have normal method and or abstract method......
pain gives gain
|
|
|
|
|
Read How to get an answer to your question
only two letters away from being an asset
|
|
|
|
|
<asp:hyperlink id="Hyperlink1" runat="server" Font-Names="Arial" ForeColor="DarkSlateGray" Width="48px"
BorderStyle="Outset" Height="18px" BorderColor="ActiveCaptionText" BackColor="ScrollBar"
NavigateUrl='<%# "FrmTempEmployeeEdit.aspx?Code=" + Eval(Server.UrlEncode("ddlcontractor.selecteditem.value").ToString()) %>'
BorderWidth="1px" Font-Bold="True">Edit</asp:hyperlink>
Hi i am trying to pass one value using hyperlink
In that i am getting compilation error...,
Name Eval is not declared like...,
Plz any one solve this probs,
Regards,
Magi
|
|
|
|
|
If I'm not mistaken then Eval can only be used within GridView, Repeater, DataGrid, ... and not in a Hyperlink.
1) try to simply remove the Eval, if this doesn't work ...
2) Call a method on your code behind code that will return the string you need:
'<%# "FrmTempEmployeeEdit.aspx?Code=" + MyMethod("ddlcontractor.selecteditem.value") %>'
in code behind
protected string MyMethod(string s)
{
return Server.UrlEncode(s);
}
-^-^-^-^-^-
no risk no funk ................... please vote ------>
|
|
|
|
|
hello,
im creating a project for my studies and i want to know how is it possisble to add more controls like CAPTCHA , avatar url to the asp.net membership provider and what are the needs i have to do in order to achive these
aneef
|
|
|
|
|
I have a linkbutton(with enable=false) in a page.
I want to make it's enable true in another page.
how can I do this?
|
|
|
|
|
If you enable that true in another page how will it help?
The user cant see as he is in a different page and the lnkbtn is in a different page!
What is you requirement?
gauthee
|
|
|
|
|
see
1) change linkbutton access specifier to public 2) go to another page(where u want to enble), create a instance of first page & set its Enabled property to true
hope it will works
regards
GV Ramana
|
|
|
|
|
My object-orientation heart breaks when I read something like that.
Don't do something like that, it is very ugly, not maintainable, not extensible, error prone, ...
-^-^-^-^-^-
no risk no funk ................... please vote ------>
|
|
|
|
|
Good Morning,
Friends, This is first time that I haven't got any reply of my post even after 26 hours nomally I get within one hour. My question could be tricky but not lengthy (I think) so here I am repeating my question again. I hope I will get answer this time. Please. It is urgent.
I am calling a .Net webservice in javascript by using "webservice.htc". It is working perfectly in IE 6 and 7 but unfortunately not in Firefox. I need to fix this problem in firefox. Please tell me solution how can I call a webservice using javascript in Mozilla Firefox browser? Please.
Kind Regards,
Abubakar
|
|
|
|
|
Hi Abubakar,
The question comes up again and again, but nowhere in the web seems to be the correct answer (although I describe it in my German JavaScript book since quite some time). The topic is using JavaScript to call Web Services from within Mozilla type browsers. Whereas this is quite well-documented and works more or less seamlessly with PHP Web Services, .NET Web Services are problematic. Calling the Web Service works, as does parsing the return data. However, on the server end, only empty parameters arrive.
The trick is to manually set the type for the parameters you are sending to the server. So after creating a parameter:
var p = new SOAPParameter(value, name);
Then, you load the correct type; in this case, I am using string, but you could use other schema types like integer, as well:
var enc = new SOAPEncoding();
enc = senc.getAssociatedEncoding(
"http://schemas.xmlsoap.org/soap/encoding/",
false);
var coll = enc.schemaCollection;
var type = coll.getType(
"string",
"http://www.microsoft.com");
Finally, you link the type to the parameter:
p.schemaType = type;
And that's it! The rest is business as usual: Instantiate the SOAPCall class, set the required properties, call encode(), call asyncInvoke(), implement a callback function, and you are done.
By the way: When using the Atlas framework, you do not need this browser-specific code any more; calling .NET Web Services works in a browser-agnostic fashion here.
SSK.
|
|
|
|
|
HI,
Thanks for this article, I have already seen this article and tried as well. It gives me error on very first line.
var p = new SOAPParameter(value, name);
I think browser doesn't recognise this. I neither understand this line, It will be really nice if you explain this little bit more or give a short example;
"The rest is business as usual: Instantiate the SOAPCall class, set the required properties, call encode(), call asyncInvoke(), implement a callback function, and you are done."
Regards,
Abubakar
|
|
|
|