|
|
Hi,
I am using master page and i inherited a aspx page and wrote html code inside asp:Content. I wrote a javascript code to get a textbox value for validation
document.getElementById("txt_Amount").value, but i could not retrieve the value. Can any one say what i am doing wrong.
|
|
|
|
|
Almost certainly you do not have a control called txt_Amount. That may be the ID on the server, but a more complex name is generated on the client. The way to access it is to insert script along the lines of:
var txtAmountId = '<%=txt_Amount.ClientID%>';
in your ASPX, and then do
document.getElementById(txtAmountId)
I'd still regard it as poor form to tack the .value on the end without first checking if the call returned something.
The quick way here is to look at your page source to see what the Id is, then you'd see where the problem lies.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at
|
|
|
|
|
Where is your textbox ? in master page or content page ? Take view source of the page and check provided textbox name is correct.
|
|
|
|
|
Textbox is in content page only, i tried this code too but not working. I saw view source i noticed the name change so i took and tried with that name.
function check_user()
{
var str = document.getElementById('ctl00_ContentPlaceHolder1_txtUsername').value;
}
|
|
|
|
|
Did you read my reply ?
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
This is how i have declared my textbox
asp:TextBox ID="txtUsername" runat="server" CssClass="textBox" Width="200px"
-- modified at 6:41 Thursday 25th October, 2007
|
|
|
|
|
OK, I take that to mean you didn't read my reply. The name of your textbox is irrelevant, my solution will work whatever you call it.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
So is it working ? Christian's suggestion is the good one than this
|
|
|
|
|
|
I have to primary Keys that define a record in a gridview how can I change 1 of those keys?
ie:
I have a recipe and the ingredients each recipe has many ingredients the primary keys are the recipe and the ingredient how can I change the ingredient in the edit mode of the gridview template.
BiG RaLpH
|
|
|
|
|
Hi,
I want to display a Bubble tooltip for a label.
Please help me out.
|
|
|
|
|
Ok now take one div tag on the top of the page and give position as absolute.
like as
div id="div_tooltip" runat="server" style="position:absolute;disply:none;">This is Lable</div
Now on page load event,Add attribute to lable
Label.Attributes.Add("onmouseover","ToolTipOver();");
Label.Attributes.Add("onmouseout","ToolTipOut();");
Javascript:
function ToolTipOver()
{
document.getElementById('div_tooltip').style.left=event.clientX;
document.getElementById('div_tooltip').style.top=event.clientY;
document.getElementById('div_tooltip').style.display="block";
}
function ToolTipOut()
{
document.getElementById('div_tooltip').style.display="none";
}
best Regard
pAthan
-- modified at 6:03 Thursday 25th October, 2007
please don't forget to vote on the post that helped you.
|
|
|
|
|
Hi pathan,
Thanks For your help.I got the bubbled tooltip now.
|
|
|
|
|
Hi,
I used this code. It works well to display only for tooltip. But i need to display a bubbled/baloon tooltip. Please help me.
|
|
|
|
|
|
Hi All,
I have a query regarding validating some server controls inside a repeater with the help of validation summary control .(The project is in asp.net 2.0 with C# as scripting language).
Actually the repeater gets bond as follows:
We have dynamic number of users(not more than 4). As per the number of users, that many items get repeated in the repeater.
There are some requiredfield and regularexpression validators inside the repeater to validate some textboxes,dropdownboxes,etc... inside the itemtemplate of the repeater.
The validationsummary control is placed out side the whole declaration of the repeater.
The validations do get fired perfectly, but the problem is that I have to display the fired validations userwise.
For e.g. imagine there are three required validators for name,email and phone & two regularexpression validators for email and phone.
If three users are bound in the repeater, then the validation summary should look like:
User 1:
- Please enter name
- Invalid email.
User 2:
- Invalid phone.
User 3:
- Please enter phone.
- Invalid email.
So how can i assign the text of User1, User 2 & User 3 in the message of validation summary (Please remember that the users are dynamic, upto 4 users can come in the repeater). Is there any way to assign the header texts of the validation summary in this manner?
It can be done in the itemdatabound of the repeater as per my thinking but I am not able to find as to how to do it.
The validation summary declaration (outside the repeater) is as below:
<asp:validationsummary id="ValidationSummary1" runat="server" font-size="X-Small" showmessagebox="true" showsummary="false">
Can anyone please show me a solution for this.
Thanx a lot for the patience to read it.
Kushan Shah,
Web Developer.
|
|
|
|
|
Hi All,
Atlast I have done the below code in the repeater's Itemdatabound(although it can be said somewhat as patch management), but it is working at present:
((RequiredFieldValidator)e.Item.FindControl("reqfav_Phone1")).ErrorMessage = "Custodian" + ind.ToString() + ":" + " " + ((RequiredFieldValidator)e.Item.FindControl("reqfav_Phone1")).ErrorMessage;
where ind.tostring() is a server control where in we show 1/2/3,...... (User 1,User 2,User 3,...........).
We have done this thing for all the validators required/regular; which were inside the repeater.
And also the display of messages is altered a bit, now the errormessages (in validation summary) look like:
User 1: Please enter email.
User 1: Please enter phone.
User 1: Invalid email.
User 2: Please enter name.
User 3: Invalid phone.
Please let me know if anyone gets a better solution for this.
|
|
|
|
|
i m devloping web mail client . mail is sending properly.but how to recive mail on my web mail client .
-- modified at 7:10 Thursday 25th October, 2007
|
|
|
|
|
Your web mail client is irrelevant. You need to write the code to recieve POP3 mail, the web part is just how you render the mail you have recieved.
As is often the case, my first google hit was on this site:
http://www.codeproject.com/cs/internet/despop3client.asp[^]
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hello guys.
I have a web pages in aspx and others in html, but the problem is my aspx cant link to the html pages.I get this error "The HTTP verb POST used to access path '/Search AL/AL Intranet - IT Department.htm' is not allowed".
Is there a specific reason why??
Thanx in advance.
kagiso
|
|
|
|
|
It's a problem with the configuration of your server. It's always worked fine for me. How are you linking, with just an HTML link, or with a Response.Redirect, or what ?
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
I have a button with a simple response.redirect.Ive never been able to do so and I have not yet uploaded the pages onto the server yet.Im testing them from my machine which should not be a problem.
kagiso
|
|
|
|
|
I'm guessing you static pages are in the same virtual directory as the application?
Cheers,
Mircea
"Pay people peanuts and you get monkeys" - David Ogilvy
|
|
|
|
|
Yes.I cudnt afford to make that mistake again but yes.
I created the link by using the properties of the button and finding the postbackURL and following finding the page I want to link to.Since they are in the same directory I cud see them.
But clicking to link I get that same error message.
kagiso
|
|
|
|