|
Add an id to the controls ?
Or if it's using server controls, you're out of luck.
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
Classical ASP ? I don't think NUnit can be used to test it.
|
|
|
|
|
Hi,
iam around this problem and stuck on this from last three days that
how i assign the columnspan value to table cell from total number of strings stored in an array.
i have declared array of string and stored employee name into it .
now i have to fine out total number of times employee name repeates in an array and assign that result to columnspan property.
please give me sugestion that how i do that
Regards
Rameez
|
|
|
|
|
Its just logical
i suppose you have to find it using C#
Just Have a
int _noOfTimes=0;
foreach(string str in ArrayOfString)
{
if(str=="NameYouHaveToSearch")
{
noOfTimes++;
}
}
Now you have number of times your name has been repeated in the Array
Cell you want to give Colspan make it runat=server and give some Id
So
SomeCell.Colspan=noOfTimes;
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
Check My Blog
|
|
|
|
|
If you need to do this for one string, step through and count them. IF you need to do it for all, do a dictionary that maps string to int, then iterate over each name, and increment or create each entry as you go. You end up with a map of name to times it occurs.
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
I have some text boxes in my web form. I have used validation control to validate those. But now i have such requirement that I want to use java script function. So how do I use both the validation control and javascript function on a single button click....
|
|
|
|
|
What i understood is you have Validators placed in the Page
You have been validating at server side
Now you want at Client side as well
Just make EnableClientScript to true to each Validator it will write
Javascript for you
But if validation are firing at client side why you want again at server side ?
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
Check My Blog
|
|
|
|
|
Thanks for your reply. I have used required field validator in my page. But now one of my control need to be validated differently on the same button click. So the validator control is not sufficient. There for I have written a javascript function and now I want to call the javascript function with the same button click. When i set the validation group of the validation control and the button control then the javascript function works. But the validator control does not work. Any help.....
|
|
|
|
|
I think client side validations are not working
For this you will have to do your validation in your own javascript funnction.
Remove Client side Validation for Required Field Validator or you can haev custom validator in that you have to implement all your validation logic.
I hope you got the point
If you don't want other validator then Just make ClientSide Scripting to false and write your own javascript method call this method on button click , you will have to return true and false from the function
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
Check My Blog
|
|
|
|
|
<asp:Button ID="Button1" runat="server" Text="Button" OnClientClick="DoSomeValidation();"/>
<asp:TextBox ID="TextBox1" runat="server" ></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"
ControlToValidate="TextBox1" ErrorMessage="RequiredFieldValidator"></asp:RequiredFieldValidator>
|
|
|
|
|
Thanks for your reply. But Please test your code. It will not work.
|
|
|
|
|
Hi
II need to be able to check if a required field validator has fired so that I can perform an action.
How would I check this?
thanks
|
|
|
|
|
If there are many Validator in the Page then you can check them
using Page.Validators property
foreach (IValidator _val in Page.Validators)
{
if (!val.IsValid)
{
// Check which validator it is by type casting
}
}
Make Sure that you should check this logic only when Page.Validate has been called means after enabling Vlidators only like Next button click
it should not get called during the Auto postbacks in the Page
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
Check My Blog
|
|
|
|
|
let me explain my scenario.
I have a ConfirmButtonExtender1 attached to a button. Before that is fired the validator should check if a radiobutton has been chosen.
If it hasnt been chosen the validation message should be shown and the ConfirmButtonExtender1 should not fire.
If the validation is fine the ConfirmButtonExtender1 should fire.
How can I get that to work?
thanks
|
|
|
|
|
Make sure that for button has CausesValidation set to true.
Now in the button click event just check
RequireFieldValID.IsValid or not
remaining things are putting lines code in right place
I think you got what you want
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
Check My Blog
|
|
|
|
|
ok ive got this
if (radiolistvalidate.IsValid == false)
{
this.ConfirmButtonExtender1.TargetProperties.Remove(this.ConfirmButtonExtender1.GetTargetProperties(this.btn_update));
}
else if (radiolistvalidate.IsValid == true)
{
}
but its still showing the confirmextender even if the validator isnt valid.
why is this?
|
|
|
|
|
Try to debug the things and see whats happening there
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
Check My Blog
|
|
|
|
|
i know whats happening; the extender control is being called before the validator control.
What I dont know is how to stop it
|
|
|
|
|
I never work with Ajax extender control but i think you will have to search for that one only
May be yo will have to attach that one at run time. Its pure guessing
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
Check My Blog
|
|
|
|
|
I want to create a rich text editor in my web page so how to do that and what all controls required.plz help me as soon as possible,thank you.
coolsatty
|
|
|
|
|
The main thing you need, is javascript. TONS of javascript.
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
Simple answer: don't - it will take you about a year to do it properly.
Use a third party control. I like FreeTextBox[^]
'Howard
|
|
|
|
|
Dear All
I built a custom control using asp.net gridview all is working fine but I can not hide/remove white border around each row cell as well as entire gridview boundary, so that my control seems awkward. Please help me how can I achieve this.
I posted sample code below.
<br />
<asp:gridview id="gv_MostPopDeal" runat="server" datasourceid="MostPopDealDataSource" autogeneratecolumns="False" allowpaging="True" pagesize="5" gridlines="None" borderstyle="None" cellspacing="1" borderwidth="0" font-bold="true" bordercolor="White" backcolor="White" font-size="Medium" rowstyle-borderstyle="None" rowstyle-bordercolor="White" rowstyle-backcolor="White" rowstyle-borderwidth="0" xmlns:asp="#unknown"><br />
<columns><br />
<asp:boundfield headertext="Merchant Name" datafield="FLL_NM" /> <br />
<br />
<asp:hyperlinkfield headertext="Click Below for details" datatextfield="OFR_TTL" datanavigateurlfields="RTLR_ID,PRMTN_ID" datanavigateurlformatstring="PromotionOfferDetials.aspx?retlrid={0}&prmtnid={1}" /><br />
<br />
</columns><br />
<rowstyle borderstyle="None" font-names="Book Antiqua" /><br />
</asp:gridview><br />
Thank you.
|
|
|
|
|
Make cellspacing="0" and cellpadding="0" and check
also remove the bordercolor="White" if you don't require and check
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
Check My Blog
|
|
|
|
|
I am creating on custom control.I have problem to create bubble event of that control.
Here is my code,In which I added one button control
protected override void RenderContents(HtmlTextWriter writer)
{
.....................
Button btn = new Button();
btn.Text=_updateTemplate.Text;
btn.ID = "ExelDataGrid_" + j.ToString() + i.ToString();
btn.CommandArgument = _rows[i - 1].ToString();
btn.CommandName = "update";
btn.RenderControl(writer);
...................
}
I have defined event
public event EventHandler Updating;
I am calling this method when buble event rise
protected virtual void OnUpdating(EventArgs e)
{
Updating(this, e);
}
protected override bool OnBubbleEvent(object source, EventArgs args)
{
OnUpdating(args);
return true;
}
Now when I use this control on my web application,then OnUpdating event doesn't call on button click event.
Can Anyone give me suggetion to solve this issue?
please don't forget to vote on the post that helped you.
|
|
|
|