|
gaurav mangal wrote:so now these textbox should have unique id. how can i do. plz reply soon.
try in this way if this work
<asp:TextBox ID='<% "cplaceofissue" + i %>' runat="server" ....
But better way to create them dynamically in code behind page.
regard
kHan
please don't forget to vote on the post that helped you.
|
|
|
|
|
Thanks Imran
for giving me the idea. but its not working.will you suggest me other code.i think it is little away from the right way.it gives it is not a valid identifier error.plz give me the idea at aspx page.how to incremwnt id .as i used it at code behind also but the id remain same.
if (!IsPostBack)
{
int k = Convert.ToInt32(s3);
for (int j = 1; j <= k; j++ )
{
for (int i = 1; i <= 4; i++)
{
TextBox TextBox1 = new TextBox();
TextBox1.ID = "stext" + i.ToString();
Panel1.Controls.Add(TextBox1);
}
}
}
in this condition id remain same .so what should i do.
in asp it works like that
|
|
|
|
|
Plz suggest me imram its very urgent .
'<% "cplaceofissue" + i %>;'
what should use in place of this.
regards
|
|
|
|
|
Pathan is right why you are not using code behind file?
Copy and paste is a design error
|
|
|
|
|
We have hosted two applications in Win 2003-IIS 6.0. We have created two websites parallel to 'Default Web site'. The domain names for both the sites are different and both the sites use forms authentication. Please help me as to how we can implement SSO between these two applications. We have the idea of implementing SSO within the same domains.
|
|
|
|
|
|
Thanks for the response.
It talks about applications in the same domain. My case the domains will be entirely different.
|
|
|
|
|
i want put a requierd field validator control in my form but not in aspx form . i want create it with programing . can anybody tell me how can i do this? and where should i write my code. in pageload() or other..
|
|
|
|
|
do you you mean a html form without "run at server"?
by the way i think checking on
onsubmit should be better
I Wish the Life Had CTRL-Z
Wizard's First Rule : People are fool,they believe what they want to believe or what they afraid to believe
www.subaitech.blogspot.com
|
|
|
|
|
sorry
<form name="form1" method="post" action="somepage" onsubmit="javascript:return my_OnSubmit();"></form>
I Wish the Life Had CTRL-Z
Wizard's First Rule : People are fool,they believe what they want to believe or what they afraid to believe
www.subaitech.blogspot.com
|
|
|
|
|
no i mean in c#.net with programing
|
|
|
|
|
Why do you want to create validators on the fly?
Can you please explain the situation?
Copy and paste is a design error
|
|
|
|
|
i use it in a sharepoint webpart and i dont have a desine form (aspx form) just i have cs form and i should define the controls with c#.net in cs file
|
|
|
|
|
i don't know anything about share point but if you mean using a RequiredFieldValidaitor Programmaticalmy :
you have some options, one of them is this :
in Page_Init() add validiator
RequiredFieldValidator rfv = new RequiredFieldValidator();
rfv.ControlToValidate = "TextBox1";
rfv.ErrorMessage = "fill it!";
this.form1.Controls.Add(rfv);
I Wish the Life Had CTRL-Z
Wizard's First Rule : People are fool,they believe what they want to believe or what they afraid to believe
www.subaitech.blogspot.com
|
|
|
|
|
This is what you want, good work subai
We are not a Code Charity
|
|
|
|
|
You need to create an object of requiredFiledValidator control and need to set all required properties like as ControlToValidate,ErrorMessage,Display etc and add it into Control object.
regards
Khan
please don't forget to vote on the post that helped you.
|
|
|
|
|
i wrote:
protected void Page_Load(object sender, EventArgs e)
{
RequiredFieldValidator fv = new RequiredFieldValidator();
fv.ControlToValidate = "TextBox1";
fv.ErrorMessage = "*";
fv.EnableViewState = true;
fv.EnableClientScript = true;
fv.Display = ValidatorDisplay.Static;
fv.EnableTheming = true;
fv.ID="fv1";
fv.EnableViewState = true;
}
but its not work
|
|
|
|
|
ptvce wrote: but its not work
Yeah.You have to add this control on the page. tell me where is your TextBox control if you do not have an .aspx page
regards
khan
please don't forget to vote on the post that helped you.
|
|
|
|
|
i create a webpart project . i dont know u work with sharepoint webpart or no but i create my controls in cs form and add my webpart to sharepoint
when i add this.Controls.Add(fv) it has error with this message:
Control 'fv1' of type 'RequiredFieldValidator' must be placed inside a form tag with runat=server.
|
|
|
|
|
I am asking about TextBox control.
Where is your TextBox control? Do not you put requiredFieldValidator control with textBox?
If you do not then put one panel control and add validator control into the panel.
Or search in google.
here I got sample code for webpart project.
Check It out.Click here title="New Window">^]
please don't forget to vote on the post that helped you.
|
|
|
|
|
iam having a check box list where iam assing dt to the checkbox list using
ChklistCnt.DataSource = dt
ChklistCnt.DataTextField = "Name"
ChklistCnt.DataValueField = "Name"
ChklistCnt.DataBind() like this
iam not getting the selected check box values. how can i get the selected vlaues of the check box
|
|
|
|
|
lakshmichawala wrote: am not getting the selected check box values. how can i get the selected vlaues of the check bo
have you tried this?
string selectedValue=ChklistCnt.SelectedItem.Value;
regards
kHan
please don't forget to vote on the post that helped you.
|
|
|
|
|
Please try yourself, It is not a difficult thing.
Google[^]
|
|
|
|
|
If you want to loop through the check box list, try to use the below code scripts:
for (int i=0; i<=CheckBoxList1.Items.Count - 1; i++)
{
if (CheckBoxList1.Items[i].Selected)
string lst += CheckBoxList1.Items[i].Text;
}
This will get the entire selected items.
Success is the good fortune that comes from aspiration, desperation, perspiration and inspiration.
|
|
|
|
|
Hi,
Reading the values from excel sheet , using those values i will generate usercontrol dynamically. usercontrol will have nearly 50 controls which is done in server side.
problem occurs if we have more than 50 records in Excel file.
It's working fine in http , but https is a problem. In HTTP it takes only 5 to 7 minutest to load 100 dynamic usercontrol in a page.
If i go for 100 records in Excel, At that time in IE takes long time and finally displays empty page. like Page cannot be found,.
it seems to be executionTimeout problem.
For that i had increased the executionTimeout =1200 and debug ="false" in web config, but still the problem occurs.
If anybody have any idea please reply me.
Thanks in advance.
Eswar.
|
|
|
|