|
i think if the valmanPhone is required field validator or any validator
you should not set IsValid property
you need to set IsRequired property true ro false
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... "
|
|
|
|
|
thanks for the reply
but there is no IsRequired property.
|
|
|
|
|
OOPs
What problem are you facing is it not firing the validation properly ?
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... "
|
|
|
|
|
actually thing is...
i want to made a field is require as per the dropdownlist item selected.
means if i select Email from my dropdown list the the Email field must become mandatory and phone field will be normal means not mandatory.
if i select Phone then phone filed must become mandatory and Email field will be not mandatory.
how to achieve this!!!
|
|
|
|
|
for what control u are trying to set the IsValid=false ..i.e is valmanEmail is a validator control? if so then set Enabled = false;
Koushik
|
|
|
|
|
Thanks for reply...
no its not working!!!!
|
|
|
|
|
You can achive through Dropdown on click Javascript event.
Based on the selected value
function EnableValidator()
{
if(document.getElementById('<%=ddlCmethod.ClientID%>').value=='Telephone')
{
ValidatorEnable(document.getElementById('<%=valmanEmail.ClientID%>'), false);
ValidatorEnable(document.getElementById('<%=valmanPhone.ClientID%>'), true);
}
else
{
ValidatorEnable(document.getElementById('<%=valmanEmail.ClientID%>'), true);
ValidatorEnable(document.getElementById('<%=valmanPhone.ClientID%>'), false);
}
}
Just call 'EnableValidator()' function on click of the dropdownlist
This will work.
Shanmugam R
|
|
|
|
|
hey thanks for ur response!
but there is no property called OnClick for dropdown list!!!
|
|
|
|
|
Just include the following code on server side (Form Load event).
drpList.Attributes.Add("onchange", "JavaScriptFunctionName();"); or
drpList.Attributes.Add("onclick", "JavaScriptFunctionName();");
We can add properties using the Attributes method.
Shanmugam R
|
|
|
|
|
I am using asp with c#. When I try run a project localhost.
I use a following step.
1. First Step right click the folder and web sharing.
2. Go To IIS And Click The Right Click Project Folder (Browse Button)
3. Then Click Any aspx Page then create problem.
The XML page cannot be displayed
Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later.
--------------------------------------------------------------------------------
A name was started with an invalid character. Error processing resource 'http://localhost/Mcp/Forms/frmAddType.aspx'. Line...
<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="frmAddType.aspx.cs" Inherits...
please help me urgently
|
|
|
|
|
I want to make the footer templet of datagrid readonly while click on edit button one thing i want to make clear in ur mind that there are two textboxs in footer templet one for id and second for name but in edit templet only one textbox is there which one is for name only so my question is that when i click on the edit button of the grid at that time the focus should not be gone into the any of textboxes which are placed in footer templet so how can i overcome this problem and get a solution.
Hiren Dave
|
|
|
|
|
I have a gridview in which a listbox is there. I want to catch the selected change event of the listbox .when the new item is selected i have to replace the data. of the row .
Can anyone help me out .
|
|
|
|
|
Find out listbox on RowCreated event of gridview and create selected event of list box.
for Example
OnRowCreated Event
ListBox lstBox=(ListBox)e.Row.FindControl("ListBoxID");
lstBox.SelectedIndexChanged+=(Press Tab 2 times here);
Protected lstBox_SelectedIndexChanged(....)
{
}
bEst rEgard
pAthan
please don't forget to vote on the post that helped you.
|
|
|
|
|
Hi all,
i am developing one web site!
in my web page i have one dropdown list for Select language.
how can i change the language for whole content of the pages!
can any body suggest me!
|
|
|
|
|
Get all strings from a resource file, and change the file you use, based on the language settng.
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 )
|
|
|
|
|
can u explain me lilbit detail!
|
|
|
|
|
Have a look here.
This gives you a starting point to look into globalization and localization of a asp.net web application.
The main aspects are:
- all language specific things are stored in resources
- the framework chooses automatically the resources that match the current culture settings (Thread.CurrentUICulture and Thread.CurrentCulture)
- all elements in your aspx definition link to an item in a resource file
-^-^-^-^-^-
no risk no funk ................... please vote ------>
|
|
|
|
|
Hi All,
I am creating div at runtime and I have to apply style to it but I am not getting how to do it.
I have created div tag like this:
HtmlGenericControl divtest = new HtmlGenericControl();
and now I want to apply the following style:
text-align: right;
display: none;
overflow: auto;
scrollbar-face-color : #ffffff;
scrollbar-highlight-color : #000000;
scrollbar-3dlight-color : #cccccc;
scrollbar-shadow-color : #000000;
scrollbar-darkshadow-color : #cccccc;
scrollbar-track-color : #cccccc;
scrollbar-arrow-color : #000000;
Please help me with this...
Thanks in advance...
|
|
|
|
|
ASP.NET 2.0 wrote: now I want to apply the following style:
divtest.Attributes.Add("style","text-align: right;display: none;overflow: auto;........... ");
bEst rEgard
pAthan
please don't forget to vote on the post that helped you.
|
|
|
|
|
Thanks for the reply sir, but its not working. I have to actually show this div tag on onmouseover so I am using Ajax HoverMenuExtender which is also created runtime.
The problem is that I am having GridView control which is created runtime and there are 2 Template column and others are BoundField Columns. Template Column is Checkbox and Linkbutton column and on the linkbutton mouseover I have to show the summary.
I dont know where I have going wrong???
Thanks again...
|
|
|
|
|
Ok.
tell me where have you used my code?
please post your
bEst rEgard
pAthan
please don't forget to vote on the post that helped you.
|
|
|
|
|
No I can see the style when I right click view source. The problem is I have to show this div tag only on mouse over div its showing all. here is the code:
I have create a class GridViewTemplate
public class GridViewTemplate: System.Web.UI.Page, ITemplate
{
ListItemType templateType;
string columnName;
private Int32 RowItems;
ArrayList arrgvCompanyName;
public GridViewTemplate(ListItemType type, string colname)
{
templateType = type;
columnName = colname;
}
public GridViewTemplate(ListItemType type, string colname, ArrayList gvCompanyName)
{
templateType = type;
columnName = colname;
arrgvCompanyName = gvCompanyName;
}
public void InstantiateIn(System.Web.UI.Control container)
{
Literal lc = new Literal();
LinkButton lb = new LinkButton();
CheckBox chk = new CheckBox();
TextBox tb1 = new TextBox();
AjaxControlToolkit.HoverMenuExtender hme2 = new AjaxControlToolkit.HoverMenuExtender();
Panel PopupMenu = new Panel();
HtmlGenericControl divtest = new HtmlGenericControl();
HtmlImage imgTop = new HtmlImage();
HtmlImage imgBottom = new HtmlImage();
switch (templateType)
{
case ListItemType.Header:
lc.Text = "<B>" + columnName + "</B>";
if (columnName == "CheckAll")
{
container.Controls.Add(chk);
}
container.Controls.Add(lc);
break;
case ListItemType.Item:
//container.Controls.Add(tb1);
if (columnName == "CheckAll")
{
container.Controls.Add(chk);
}
//else if(columnName="CompanyName")
//{
//}
else
{
if (arrgvCompanyName.Count > 0)
{
columnName = arrgvCompanyName[RowItems].ToString();
lb.Text = columnName;
lb.CommandName = "cmd";
hme2.TargetControlID = "lb";
hme2.PopupControlID = "PopupMenu";
//hme2.PopupPosition = Center;
hme2.OffsetX = 60;
hme2.OffsetY = -15;
hme2.PopDelay = 10;
//Add Top Image For Showing Summary
imgTop.Src = "../../images/top_01.png";
imgTop.Width = 272;
imgTop.Height = 24;
//Add Sytle to div Tag
//divtest.ClientID = "dvtest";
divtest.Attributes.Add("class", "myclass");
divtest.InnerHtml = "My Summary For Testing";
//Add Bottom Image For Showing Summary
imgBottom.Src = "../../images/bottom_01.png";
imgBottom.Width = 247;
imgBottom.Height = 7;
PopupMenu.Controls.Add(imgTop);
PopupMenu.Controls.Add(divtest);
PopupMenu.Controls.Add(imgBottom);
container.Controls.Add(lb);
container.Controls.Add(PopupMenu);
RowItems++;
}
else
{
lb.Text = columnName;
lb.CommandName = "cmd";
container.Controls.Add(lb);
}
}
//container.Controls.Add(chk);
break;
}
}
}
and from code behind I am calling this as:
foreach (DataColumn objDC in myTable.Columns)
{
if (objDC.ColumnName == "CheckAll")
{
TemplateField chkColumn = new TemplateField();
chkColumn.HeaderTemplate = new GridViewTemplate(ListItemType.Header, "CheckAll");
for (int j = 0; j <= myTable.Rows.Count - 1; j++)
{
chkColumn.ItemTemplate = new GridViewTemplate(ListItemType.Item, "CheckAll");
}
gvWatchList.Columns.Add(chkColumn);
}
else if (objDC.ColumnName == "CompanyName")
{
TemplateField linkbtnColumn = new TemplateField();
linkbtnColumn.HeaderTemplate = new GridViewTemplate(ListItemType.Header, "CompanyName");
//linkbtnColumn.ItemTemplate = new GridViewTemplate(ListItemType.Item, myTable.Rows[iCompCount][1].ToString());
ArrayList score = new ArrayList(myTable.Rows.Count);
for (int j = 0; j <= myTable.Rows.Count - 1; j++)
{
score.Add(myTable.Rows[j][1].ToString());
//gvWatchList.Rows[j].Cells.Add(tt);
}
//linkbtnColumn.ItemTemplate = new GridViewTemplate(ListItemType.Item, score.ToString());
linkbtnColumn.ItemTemplate = new GridViewTemplate(ListItemType.Item, "", score);
GridViewTemplate temp = new GridViewTemplate();
temp.RowItem = score.Count;
gvWatchList.Columns.Add(linkbtnColumn);
}
else
{
BoundField bField = new BoundField();
bField.DataField = objDC.ColumnName;
bField.HeaderText = objDC.ColumnName;
gvWatchList.Columns.Add(bField);
}
}
gvWatchList.RowStyle.CssClass = "GridRowColor";
gvWatchList.HeaderStyle.CssClass = "GridHeader";
gvWatchList.AlternatingRowStyle.CssClass = "GridAlternateRowColor";
gvWatchList.CssClass = "grid-text";
gvWatchList.DataSource = myTable;
gvWatchList.DataBind();
}
this is wat I am using in User Control.
Thanks again...
|
|
|
|
|
If you are adding styles I would suggest using a CSS class rather than explicity adding it in code, it makes it more managable and reusable
divtest.attributes.add("class", "myclass")
and then define in a CSS file myclass with the attributes you want
div.myclass
{
text-align: right;
display: none;
overflow: auto;
scrollbar-face-color : #ffffff;
scrollbar-highlight-color : #000000;
scrollbar-3dlight-color : #cccccc;
scrollbar-shadow-color : #000000;
scrollbar-darkshadow-color : #cccccc;
scrollbar-track-color : #cccccc;
scrollbar-arrow-color : #000000;
}
It also means you dont have to recompile if you need to make changes.
However, if you do need to apply it directly in code for some reason then i would suggest using the built in style property which can be strongly typed which is always nice, as follows
divtest.Style.Add(HtmlTextWriterStyle.TextAlign, "right")
or for ones which are not included in the strongly typed list use
divtest.Style.Add("scrollbar-face-color", "#000000")
Hope that helps
|
|
|
|
|
Thanks for the reply sir, but its not working. I have to actually show this div tag on onmouseover so I am using Ajax HoverMenuExtender which is also created runtime.
The problem is that I am having GridView control which is created runtime and there are 2 Template column and others are BoundField Columns. Template Column is Checkbox and Linkbutton column and on the linkbutton mouseover I have to show the summary.
I dont know where I have going wrong???
Thanks again...
|
|
|
|
|
Both sets of code provided as answers will work, and are valid ways of doing it, but you seem to have a specific implementation issue here.
Can you please just let me know what the issue is that you are having - does the div show? Is it just missing the style information?
|
|
|
|