|
Apparently it's not urgent enough to answer you. Or he didn't understand you. Or he copied and pasted your reply and it would not compile
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 )
|
|
|
|
|
Hey.
I have a anthem:PlaceHolder inside a asp:Repeater that contains an asp:RadioButtonList
something like
<br />
<asp:repeater id="rp" runat="server" gt;<br="" mode="hold" />HeaderTemplate> table></HeaderTemplate<br />
ItemTemplate><br />
td><anthem:ImageButton id="ibPt" runat="server"></anthem:ImageButton><br />
<anthem:PlaceHolder id="phPt" runat="server"><br />
<asp:Literal ID="liPt" Runat="server"></asp:Literal><br />
<asp:RadioButtonList ID="rblPt" Runat="server" Visible="False"></asp:RadioButtonList><br />
</anthem:PlaceHolder></td
And I have added a click event on my anthem:ImageButton that shall fill the RadioButtonList with items and make it Visible="true"
something like
private void OnPt(object sender, ImageClickEventArgs e)<br />
{<br />
MiBlo.Product bloProduct = null;<br />
Anthem.ImageButton aibtnPartType = (Anthem.ImageButton)sender;<br />
try <br />
{ <br />
System.Web.UI.WebControls.RepeaterItem riSL = (System.Web.UI.WebControls.RepeaterItem)aibtnPartType.Parent;<br />
<br />
int lngProductID = int.Parse(aibtnPartType.CommandName);<br />
int lngCatalogID = int.Parse(aibtnPartType.CommandArgument);<br />
<br />
bloProduct = new MiBlo.Product();<br />
<br />
DataView dvProductPartTypes = bloProduct.GetProductPartTypes(lngProductID, lngCatalogID);<br />
<br />
aibtnPartType.UpdateAfterCallBack = true;<br />
aibtnPartType.Visible = false;<br />
<br />
Anthem.PlaceHolder phPt = (Anthem.PlaceHolder)riSL.FindControl("phPt"); <br />
Literal liPt = (Literal)phPt.FindControl("liPt");<br />
liPt.Text = "";<br />
liPt.Visible = false;<br />
<br />
RadioButtonList rblPt = (RadioButtonList)phPt.FindControl("rblPt");<br />
rblPt.Visible = true;<br />
rblPt.RepeatColumns = 1;<br />
<br />
<br />
for(int i = 0; i < dvProductPartTypes.Count; i++)<br />
{<br />
RadioButton rb = new RadioButton();<br />
rb.Text = dvProductPartTypes[i]["dblNumberInUnit"].ToString();<br />
rb.GroupName = "rblPt"; <br />
<br />
rblPt.Controls.Add(rb);<br />
}<br />
<br />
phPt.UpdateAfterCallBack = true;<br />
}<br />
catch (Exception err) <br />
{<br />
lblMessage.Text += err.Message;<br />
}<br />
}
It enters the code and everything seems OK, but it won't show. I tryed just to set the Literal liPt.Text = "Test" and not setting it
to liPt.Visible = false and that is shown correctly.
But I have no idea why the RadioButtonList won't show.
I have allso tried an anthem:RadioButtonList insted of an asp:RadioButtonList inside an anthem:PlaceHolder but it gave the same
result.
Anyone know the RadioButtonList won't show?
Thanks
Thomas
|
|
|
|
|
It's not RadioButton one should add, but ListItems
as in:
for(int i = 0; i < dvProductPartTypes.Count; i++)<br />
{<br />
ListItem li = new ListItem();<br />
li.Text = dvProductPartTypes[i]["dblNumberInUnit"].ToString();<br />
rblPt.Items.Add(li);<br />
}
|
|
|
|
|
How do we connect to a database from .aspx page?
Regards,
LEE
|
|
|
|
|
There are thousands of articles in the web including codeproject.
Use Goole[^] to find it.
*jaans
|
|
|
|
|
http://aspnet.4guysfromrolla.com/articles/032702-1.aspx
http://msdn2.microsoft.com/en-us/library/ms178371.aspx
check these out
|
|
|
|
|
Hi
I have 20 different textboxes on a page
I need to make them all disabled.
IS there a way I can do this e.g. in a loop rather then writing out each textbox in the c# code?
thanks inadvance!
|
|
|
|
|
Iterate through the Page.Controls collection, check whether the control is a textbox, if yes set Enabled=false .
|
|
|
|
|
thanks for the reply
I have this so far
for (int x = 0; x < Page.Controls.Count; x++)
{
if (Page.Controls
}
How would I check if the control is a button and then set enable to false
would it be something like
Page.controls.Button.Enabled = false?
thanks!!
|
|
|
|
|
foreach (Control c in Page.Controls)
{
if(c is TextBox)
c.Enabled = false;
}
|
|
|
|
|
Hi
it says attrivute enabled is not recognised, I can make it invisible but not disabled
what would be the reason for this?
thanks so far!
|
|
|
|
|
Try this
foreach (Control c in form1.Controls)
{
if (c is TextBox)
(c as TextBox).Enabled = false;
} where form1 is your form name.
|
|
|
|
|
Hi
The syntax built this time but none of the textboxes are disabled.
Am I missing something?
thanks
|
|
|
|
|
It's working here. Put break point and check it is executing.
|
|
|
|
|
ive got the code in the page _load, its def running but not working:
foreach (Control c in form1.Controls)
{
if (c is TextBox)
(c as TextBox).Enabled = false;
}
|
|
|
|
|
I think you are doing little bit mistake in foreach line. Please try below code
foreach (Control c in this.Page.Form.Controls )
{
if (c is TextBox)
((WebControl)c).Enabled = false;
}
Parwej Ahamad
g.parwez@gmail.com
|
|
|
|
|
Hi
No sorry the controls are still enabled on the form, this is weird...
I am using VWD.
|
|
|
|
|
This code is working
|
|
|
|
|
I want to compare the numeric value of 2 textboxes using javascript function.
Thanks
|
|
|
|
|
delcare the two textboxes
then write
if textbox1 = textbox 2 then
something
endif
|
|
|
|
|
a-+s-+p-+ wrote: if textbox1 = textbox 2 then
something
endif
This looks like a VBScript right?
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson
|
|
|
|
|
was tring to give a general idea of what syntax was needed
|
|
|
|
|
Better way would be using CompareValidator control. Also check Page.IsValid on server side.
|
|
|
|
|
Try this function.
It will check whether both the textboxes are having numeric values and will swap if the first is greater than second.
function CheckRange()
{
var a1=0;
var a2=0;
a1=document.forms[0].textfield1.value;
a2=document.forms[0].textfield2.value;
var a111=0;
var a222=0;
a111=a1*1;
a222=a2*1;
if (a111!=a1 || a1=="" || a1==" ")
{
alert("Enter a numeric value");
document.forms[0].textfield1.focus();
return false;
}
else if (a222 !=a2 || a2=="" || a2==" ")
{
alert("Enter a numeric value");
document.forms[0].textfield2.focus();
return false;
}
else
{
if (a1>a2)
{
temp=a2;
a2=a1;
a1=temp;
document.forms[0].textfield1.value=a1;
document.forms[0].textfield2.value=a2;
}
}
return true;
}
*jaans
|
|
|
|
|
Friends,
How can i detect if there is a real player installed in my system or not using asp.net
Regards,
Rahul
|
|
|
|