|
ypki wrote: Contentplaceholder?
can we get document object from here?
Javascript don't understand Master pages/Content pages. All these will be rendered together to produce page. So you can write it anywhere.
|
|
|
|
|
but i cant get the control in content.
I try document.formname.textbox1 and document.getelementbyid("textbox1")
both showing unidentify in javascript
I am trying to use calenser control
|
|
|
|
|
ypki wrote: I try document.formname.textbox1 and document.getelementbyid("textbox1")
document.getElementById(<% textbox1.ClientId > )
|
|
|
|
|
Hi,
after running your application page,see page source. In that you will see that your control named textbox1 is chaged to "ctl00_contextplaceholderName_textbox1". so see that new ID and then get from javascript.
Thanks,
Sun Rays
|
|
|
|
|
hi...
i am having a contentpage which has many textboxes.Pls let me know the code(in c#)to clear textboxes at a button click.
SunithaNallana
|
|
|
|
|
SunithaNallana wrote: to clear textboxes at a button click.
Clearing textbox value ?
|
|
|
|
|
yes to clear textboxes values
SunithaNallana
|
|
|
|
|
Content place holder will have Control collection property. Iterate through each item and check if it is TextBox. If yes clear the text.
|
|
|
|
|
thank u all
i cleared my doubt.
i have done it this way...
1.in the master page i put a property block in which i wrote
public ContentPlaceHolder CPH
{
get{return ContentPlaceHolderid;}
}
2.i made the content page strongly typed ie..
<mastertype virtualpath="masterpagefile path">
3.in button click function
foreach(control c in Master.CPH.Controls)
{
if(c.getType().Name == "TextBox")
{
(c as TextBox).Text ="";
}
}
SunithaNallana
|
|
|
|
|
Not a good way of doing but you can try
ArrayList al = new ArrayList();
foreach(Control c in Page.Form.Controls)
{
if(c.GetType() == typeof(TextBox))
{
al.Add(c);
}
}
foreach(TextBox t in al)
{
t.Text = "";
}
But There should be any other better way to do it.
here I have assumed that you have all the textboxes in same form. In case its not true You will have to loop through all the forms.
Happy Birthday!!!
|
|
|
|
|
Prateek G wrote: ArrayList al = new ArrayList();
foreach(Control c in Page.Form.Controls)
{
if(c.GetType() == typeof(TextBox))
{
al.Add(c);
}
}
foreach(TextBox t in al)
{
t.Text = "";
}
No need to loop 2 Times.
foreach(Control c in Page.Form.Controls)
{
if(c.GetType() == typeof(TextBox))
{
Textbox t = (Textbox)c;
t.Text = "";
}
}
Thanks,
Sun Rays
|
|
|
|
|
Prateek G wrote: foreach(Control c in Page.Form.Controls)
This will clear all textbox controls in page. I think question is how to clear the textbox in content place holder.
|
|
|
|
|
thank u all
i cleared my doubt.
i have done it this way...
1.in the master page i put a property block in which i wrote
public ContentPlaceHolder CPH
{
get{return ContentPlaceHolderid;}
}
2.i made the content page strongly typed ie..
<mastertype virtualpath="masterpagefile path">
3.in button click function
foreach(control c in Master.CPH.Controls)
{
if(c.getType().Name == "TextBox")
{
(c as TextBox).Text ="";
}
}
SunithaNallana
|
|
|
|
|
thank u Prateek.G
for wishing me on my birthday.
SunithaNallana
|
|
|
|
|
Try this and call this function on the server side.
< script >
function Clear()
{
obj=document.getElementsByTagName("INPUT");
for(i=0;i< obj.length;i++)
{
if ((obj[i].type == "text"))
{
obj[i].value = "";
}
}
< /script >
Let me know whether you got the solution.
God is always with you.
|
|
|
|
|
Saranya Devi wrote: function Clear()
{
obj=document.getElementsByTagName("INPUT");
for(i=0;i< obj.length;i++)
{
if ((obj[i].type == "text"))
{
obj[i].value = "";
}
}
This will clear all textboxes, not in the controls in content page
|
|
|
|
|
thank u all
i cleared my doubt.
i have done it this way...
1.in the master page i put a property block in which i wrote
public ContentPlaceHolder CPH
{
get{return ContentPlaceHolderid;}
}
2.i made the content page strongly typed ie..
<mastertype virtualpath="masterpagefile path">
3.in button click function
foreach(control c in Master.CPH.Controls)
{
if(c.getType().Name == "TextBox")
{
(c as TextBox).Text ="";
}
}
SunithaNallana
|
|
|
|
|
hi friends
now i am doing content management system(CMS)..
my doubt is i have one dropdownlist like this
<asp:dropdownlist id="ddlalign" autopostback="true" runat="server">
<asp:listitem value="Left">Left
<asp:listitem value="Right">Right
<asp:listitem value="Center">Center
if i do some modification in the page then i click left modified page will display in left place of enduser page.
how can i do this
Known Is Drop.Unknown Is Ocean
|
|
|
|
|
You could look at the stuff in 2005 that supports being able to drag and drop to move parts of the UI. Otherwise, the answer is you need to remember the settings and write code that dynamically places UI elements.
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 a pretty basic task. Do you not know how to access the roles from your database ? Don't know how to use a grid control to render the roles from the DB and dynamically check them ? Have you thought to ask your co-workers, given that the answer really depends on the way that your roles are stored, etc ?
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 2 DataLists (DataList1 & DataList2)
DataList 2 is in the Item Tempalte of DataList 1 ..
i wanna Loop in the DataList2 Items ..
i mada a ForEach Loop and put it in the DataList2_ItemDataBound it works
but it doesn't reach to the last Item .. why ?? (
and when i put the same loop in the button click event it gets all items ..
|
|
|
|
|
hi,
do u debug yr application putting break pint in datalist2_itemdatabound ?
check it out...
Thanks,
Sun Rays
|
|
|
|
|
Hi,
I am looking for proper documentation on how to develop a wiki using ASP.net. Is there any link or article available for the same.
|
|
|
|
|
A wiki is a pretty simple sort of site. I can't imagine it needing any special advice. Where are you stuck ?
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 dont have any idea about it. I dont even started working on it. First I want to read something about it and then only I will proceed further.I am just confused about words web2.0 etc and I am not aware of there use in ASP.net.
Candidly speaking I am just fascinated towards wiki and I want to develop it.But I dont have idea what I will have to do
Dont mind I want to develop a thing abt which I dont know anything...
|
|
|
|