|
|
hello sir,
how to use javascript with masterpage in asp.net2.0?
|
|
|
|
|
puspendra napit wrote: how to use javascript with masterpage in asp.net2.0?
The same way you would use it in a normal ASP.NET web form.
You need to be more specific about the nature of your problem.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
Response.AddHeader is not working in modalDialog window.So I can't Open attachments.Any body have a solution.Lot of Thanks in advance .
Arun J
|
|
|
|
|
Hello Friends,
I'm providing the Javascript validation(s) in the Content Page of the Master Page
So my Javascript validation's code is given below :-
function validation()
{
if(document.getElementById("<%=ddlProgramme.ClientID %>").value=="Select")
{
window.alert("Please Select Your Programme");
document.getElementById("<%=ddlProgramme.ClientID %>").focus();
return false;
}
if(document.getElementById("<%=txtName.ClientID %>").value=="")
{
window.alert("Please Enter Your Name");
document.getElementById("<%=txtName.ClientID %>").focus();
return false;
}
}
and also provide the path for this js file in the Master Page as given below
<script language="javascript" src="../Script/JScript2.js"></script>
But my validation is not being fired as it must be....and also not throwing any error.............
But if i put my js code given above in the content page directly then it works perfectly...........................
But i want to call my validation in js file and want to call them from master page or content page........
|
|
|
|
|
The Knowledge wrote:
The js file will not be parsed by ASP.NET, so your client ids will never get written properly. You need to create those variables with script in your aspx or injected via the code behind.
Didn't Shog tell you that already in the web dev forum ?
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 )
|
|
|
|
|
Thnx for your suggestion but can you please explain it a bit more.......
|
|
|
|
|
I'm not sure what else to say. Shog probably explained it a little better, but you didn't get it then, either.
The <% %> sections are not executed because it's in a js file. So, you need to write at least the part that stores the client Ids, outside of the js file. The way to segregate that code is to create js variables that contain the client Ids.
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 )
|
|
|
|
|
|
Hi all,
How can I set value of a text box from selection of items from the asp listbox or we can use any html control by javascript, since selectedIndex not working for the list box.. following is the code...
]]>
<title>State Management
function ShowList()
{
document.getElementById('helptypediv').style.visibility='visible';return false;
}
function HideList()
{
document.getElementById('helptypediv').style.visibility='hidden';return false;
}
function ShowText()
{
var txtMessage = document.getElementById('lstShowHistory').options[selectedIndex].text; //Not Woking selectedIndex here
document.getElementById('txtUrlLink').value = txtMessage;
document.getElementById('helptypediv').style.visibility='hidden';return false;
}
<asp:textbox id="txtUrlLink" runat="server" width="200px" cssclass="DataEntry">
|
<asp:listbox id="lstShowHistory" runat="server" cssclass="DataEntry" width="200px">
<asp:listitem selected="True">Url Name 1
<asp:listitem>Url Name 2
<asp:listitem>Url Name 3
<%--
Url Name 1
Url Name 2
Url Name 3
--%>
|
CS File Code
I have the following code on page load event of the page..
lstShowHistory.Attributes.Add("onchange", "ShowText();");
Vishnu Narayan Mishra
Software Engineer
|
|
|
|
|
Vishnu Narayan Mishra wrote: 'lstShowHistory'
When working with ASP.NET, always look at the HTML source when something doesn't work. Even better, install Firefox and firebug, and debug your javascript in realtime.
If these are server controls ( and if they are not, this belongs in the web dev forum ), if you look at your source, your service control called lstShowHistory is almost certainly not called that on the client. So, you need to inject javascript that creates variables that contain the client side Id's of these controls, then this sort of code will work.
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 )
|
|
|
|
|
do your form authentication is working perfectly in internet 7.0 in same browser in different tab please verify
modified on Sunday, August 31, 2008 1:58 PM
|
|
|
|
|
I'm not sure what you're asking ?
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 Sir/Mam
can anyone please tell me how to get time in asp.net is there
any control seperately
regds
venkat
|
|
|
|
|
Use dateTime control or use DateTime class to simply get Dattime value.
Hello Forum
Always be in touch to help about the topic ASP.NET
|
|
|
|
|
use DateTime to get current Date and Time
Yogesh
|
|
|
|
|
1 - try using meaningful headers, all the questions here are about ASP.NET
2 - try asking clear questions. If you don't know how to use DateTime.Now, then you should be buying a book and reading it. If you wanted to show the time on your website ( local or server ), then that's not what you asked.
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 )
|
|
|
|
|
Hi Friends..
I am having a .aspx page in which i have dropdown list box.I am binding values to the dropdownlist from the database..There are five items in the dropdown list box..When i run my .aspx page and select items it is not displayed properly.i.e for example if i select the fourth item the third item is selected..But all the other items which i select are displayed correctly..Only at the time of selecting the fourth item,the third item is shown.What could be the problem ..? Someone help in this regard as early as possible.
Regards,
Balaguru
|
|
|
|
|
Hi Dude !!
Keep a debugging point on a selected index change go through the values you will definately know what is happening
if you can post a piece of code what you written we can definately help you out by verifying
Happy Coding
modified on Sunday, August 31, 2008 1:54 PM
|
|
|
|
|
Balagurunathan S wrote: Someone help in this regard as early as possible
When you're paying for help, you can say stuff like this.
It's hard to follow quite what you mean, you're saying that if you select item four and it posts back, item three is shown ? Have you set breakpoints to step through the code and see what's going on ? I doubt we can help you without seeing some code and some comments on what you see in the debugger.
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 )
|
|
|
|
|
Dear Graus,
I am just binding values to the dropdownlist from the database using the following code.Here ldset is the dataset
ldset = gobjClass.CW_GETBETOPT()
Dim lBetViewFilter As New DataView
lDataRow = lDataViewFilter.Item(0).Row
lBetViewFilter = FindValueInBetViewReturn(ldset, "GAMEID='" &lDataRow("GameID") &"'")
Me.DropDownList1.DataSource = lBetViewFilter
Me.DropDownList1.DataTextField = "bettypedesc"
Me.DropDownList1.DataValueField = "BetTypeId"
Me.DropDownList1.DataBind()
Me.DropDownList1.SelectedIndex = 0
The problem is exactly what u said that is if i select item four and it posts back, item three is shown ..Kindly help in this regard..
Thanks in Advance..
Balaguru
|
|
|
|
|
hi
i have a button. in button click i write this code:
Response.Redirect("http://spserver3:3030/site2/Shared%20Documents/Forms/AllItems.aspx?View={1753B955-263E-42C0-A330-2E8A966E30E4}&FilterField1=ContentType&FilterValue1=" + "AAA");
i want the bold text encode to this: "%D8%AC%D9%84%D8%B3%D9%87" but i dont know how i can encode
|
|
|
|
|
Unable to understand the problem could you plz explain it properly
Yogesh Agarwal
|
|
|
|
|
|
What is the problem?
only two letters away from being an asset
|
|
|
|