|
thanks for reply...it could be any tags...i can have them hardcode predefined tags
|
|
|
|
|
Hi,
My senario: I have a sign-up form which, amoungst others, has a username textbox. The username textbox has autopostback set to true which, when posted back, checks to see if the entered username already exists in the DB and displays a message if so.
This works fine. But the problem I have is that in the code behind I am setting the focus to a control after doing the username check ( using txtUsername.Focus() ). But doing this causes the page to jump back to the top. This doesn't happen if I don't give a control the focus.
Any ideas how I can solve this?
A little more info about my form just in case it's relevant. The form is in an AJAX Accodion control which is in an AJAX Update Panel.
Thanks
|
|
|
|
|
Why dont you use
document.getElementById('textbox').focus();
in onload of the page ??
|
|
|
|
|
Wouldn't that set the focus to that particular textbox every time the page was loaded? I need to be able to set the focus to a different textbox depending on the result of the username check, i.e. if the check fails then set focus to txtUsername but if it passes then set focus to txtPassword.
But also, when the page is loaded for the first time then the focus needs to be set to yet a different control. So using Javascript how would I determine which control to give the focus to?
Thanks for help by the way
|
|
|
|
|
Well, if the page is actually posted back, you might consider adding a script block using RegisterScriptBlock to the client page to have the proper textbox focus.
It is not usually great to do focus in server side in case of ASP.NET.
use txtBox.ClientId to get the id on the control to be focus.
But If I was in your situation, I would have invoked an AJAX call to the server, and get if it is available or not. It is really unnecessary to fully postback the page for this.
|
|
|
|
|
Abhishek Sur wrote: But If I was in your situation, I would have invoked an AJAX call to the server, and get if it is available or not.
Ah, didn't realise that I could do this (I am a newbie to ASP.NET )
Thanks again for your help.
|
|
|
|
|
Hi developers,
I am having a great challenge in my .aspx pages. I have a .css file for my site layout, but each time I add a page and add a lenghtly contents (i.e a long content), it does stay static and not resized automatically. This does not give me flexibility of page layout that I want (page height resizing dynamically). Although, the #content height was specified in pixels. But if I had not specified the #content height in my css file, the page can be resized dynamically.
Please help.
Tunsten
|
|
|
|
|
If you specify height in Pixels, it will not automatically resize according to content length. One thing you can do, is you can make overflow:auto to have scrollbar when content length goes greater than the height.
If you remove the setting of height of the element, it will automatically spread itself.
|
|
|
|
|
Thanks a lot.
I am grateful.
Tunsten
|
|
|
|
|
Hi all,
How can I point to an HTML file if I am setting the IsHtmlBody = true in my app?
Please help.
Tunsten
|
|
|
|
|
|
A lots of thanks. I appreciate that.
Tunsten
|
|
|
|
|
Hi,
Below line of code is not working with FireFox.
Please let me know where I am wrong.
document.getElementById('txtAdd').innerText = valuefinal.toFixed(5);
Frank
Software Developer
www.mindstick.com
modified on Friday, November 20, 2009 10:44 AM
|
|
|
|
|
|
innerText will not work in Firefox I guess.
You can use innerHTML .
Also there might be sometimes the control may have child elements so it is better to remove those elements first.
To Clear a container use
var element = document.getElementById('txtCommissionBalance');
while(element.firstChild)
element.removeChild(element.firstChild);
After it removes all the element, do set the innerHTML .
|
|
|
|
|
Hi all,
I have Outer Gridview and Inner Gridview , Inner Gridview Contains the Checkboxes now if Outer Gridview Check box Checked then Inner Gridview Checked enables false else vice versa.
Now my Probelm is that how i access the inner Gridview items and insert into database if outer Gridview checkbox not checked
Share me the Ideas
Best Regards,
Thanks in advance
|
|
|
|
|
You might consider RowDataBound event to find the control.
use like this :
Sub CustomersGridView_RowDataBound(ByVal sender As Object, ByVal e As GridViewRowEventArgs)
If e.Row.RowType = DataControlRowType.DataRow Then
'now use e.Row.FindControl to get the gridview.
End If
End Sub
Hope you got the solution.
|
|
|
|
|
Is it possible to assign a default role in asp.net role and membership provider.......for e.g. there is two roles in my website.......Ist is Admin and IInd is Customer...........and if any user registers himself...........he must be automatically assigned to customer role..........is it possible...........plz guide me a bit.......
|
|
|
|
|
|
Do it Programatically.Add this Code
Roles.AddUserToRole("UserName","Customer")
LatestArticle :Log4Net
Why Do Some People Forget To Mark as Answer .If It Helps.
|
|
|
|
|
i want to open my website automatically in Compatibility mode in IE8 in ASP.NET(C#).
|
|
|
|
|
You mean your system is running with IE8, but you want to open your web application with Compatibility Mode of Browser ?
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
actaully i made a project in ASP.Net
its working fine in IE6 but not working well in IE8, it works well in IE8 only when i click the Compatibility mode..
so i want is my project work well in IE8 without clicking on "Compatibility Mode"
|
|
|
|
|
Ohh...Then you need to concentrate on CSS only. and Why IE6.... Its too backdated.. I think..
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|