Unable to find control id 'TextBox1' referenced by the 'ControlToValidate' property of 'RequiredFieldValidator1'.

Unable to find control id 'TextBox1' referenced by the 'ControlToValidate' property of 'RequiredFieldValidator1'.

i'm getting error when i the page is derived from master.page.

i'm using a "required field validator" to validate same web user control in the master.page

files are:

master.page
default3.aspx (content of master.page)
ucUserControlPage

"Unable to find control id 'ctl00_ContentPlaceHolder1_PanelID_VisitDetails2_UcHostName1_ddlHostName_wrapper' referenced by the 'ControlToValidate' property of 'rfvHostName'."

 

 


Its all about coding!
0
nisarkhan
9/7/2006 1:58:15 PM
asp.net.navigation-controls 13714 articles. 0 followers. Follow

12 Replies
3760 Views

Similar Articles

[PageSpeed] 29

Where is the validator located?

If it's located in the content page, so you may set the ControlToValidate property in Page_Load as:

validateCtrl.ControlToValidate = ((TextBox)Master.FindControl("ControlID")).ClientID

If it's in masterpage, i'm afraid it should work smoothly, at least, it works for me. Try to do some independent test.

Hope it helps!^_^

0
lostlander
9/8/2006 3:36:57 AM
lostlander:

Where is the validator located?

If it's located in the content page, so you may set the ControlToValidate property in Page_Load as:

validateCtrl.ControlToValidate = ((TextBox)Master.FindControl("ControlID")).ClientID

If it's in masterpage, i'm afraid it should work smoothly, at least, it works for me. Try to do some independent test.

Hope it helps!^_^

 here is my code very simple:

ASCX - WEB USERCONTROL:
=================
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ucDatePicker.ascx.cs" Inherits="ucDatePicker" %>
<asp:TextBox runat="server" ID="TextBox1"></asp:TextBox>

ASCX.CS - WEB USERCONTROL:
=================

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Telerik.WebControls;


public partial class ucDatePicker : System.Web.UI.UserControl
{
    public TextBox textbox
    {
        get
        {
            return TextBox1;
        }
    }
}


ASPX :
=================

<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="Default3.aspx.cs" Inherits="Default3" Title="Untitled Page" %>
<%@ Register Src="ucDatePicker.ascx" TagName="ucDatePicker" TagPrefix="uc1" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
    <td valign="top" class="text">
        <uc1:ucDatePicker ID="UcDatePicker1" runat="server" />
        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="RequiredFieldValidator"></asp:RequiredFieldValidator>
    </td>
</tr>
</table>
</asp:Content>

ASPX.CS:
=================

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Telerik.WebControls;
public partial class Default3 : System.Web.UI.Page
{
    public ContentPlaceHolder content;

    protected void Page_Load(object sender, EventArgs e)
    {
        RequiredFieldValidator1.ControlToValidate = UcDatePicker1.textbox.ID; // I HAVE TRIED CLIENTID, UNIQUIEID, ID (none of them work)
        RequiredFieldValidator1.ErrorMessage = "select date";

    }

    protected void Button1_Click(object sender, EventArgs e)
    {

    }
}

MASTER PAGE:
=================

<%@ Master Language="C#" AutoEventWireup="true" CodeFile="MasterPage.master.cs" Inherits="MasterPage" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        &nbsp;<table border="0" cellpadding="0" cellspacing="0" style='width: 100%; height: 100%'>
            <tr>
                <td colspan="2" style='height: 7px'>
                    header</td>
            </tr>
            <tr>
                <td style='width: 200px; height: 533px'>
                    left</td>
                <td style='height: 533px'>
        <asp:contentplaceholder id="ContentPlaceHolder1" runat="server">
        </asp:contentplaceholder>
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    foo</td>
            </tr>
        </table>
    </div>
    </form>
</body>
</html>

MASTER PAGE CODE BEHIND:
======================

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class MasterPage : System.Web.UI.MasterPage
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
}


Its all about coding!
0
nisarkhan
9/8/2006 1:18:07 PM
lostlander:

Where is the validator located?

If it's located in the content page, so you may set the ControlToValidate property in Page_Load as:

validateCtrl.ControlToValidate = ((TextBox)Master.FindControl("ControlID")).ClientID

If it's in masterpage, i'm afraid it should work smoothly, at least, it works for me. Try to do some independent test.

Hope it helps!^_^

 here is my code very simple:

ASCX - WEB USERCONTROL:
=================
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ucDatePicker.ascx.cs" Inherits="ucDatePicker" %>
<asp:TextBox runat="server" ID="TextBox1"></asp:TextBox>

ASCX.CS - WEB USERCONTROL:
=================

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Telerik.WebControls;


public partial class ucDatePicker : System.Web.UI.UserControl
{
    public TextBox textbox
    {
        get
        {
            return TextBox1;
        }
    }
}


ASPX :
=================

<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="Default3.aspx.cs" Inherits="Default3" Title="Untitled Page" %>
<%@ Register Src="ucDatePicker.ascx" TagName="ucDatePicker" TagPrefix="uc1" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
    <td valign="top" class="text">
        <uc1:ucDatePicker ID="UcDatePicker1" runat="server" />
        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="RequiredFieldValidator"></asp:RequiredFieldValidator>
    </td>
</tr>
</table>
</asp:Content>

ASPX.CS:
=================

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Telerik.WebControls;
public partial class Default3 : System.Web.UI.Page
{
    public ContentPlaceHolder content;

    protected void Page_Load(object sender, EventArgs e)
    {
        RequiredFieldValidator1.ControlToValidate = UcDatePicker1.textbox.ID; // I HAVE TRIED CLIENTID, UNIQUIEID, ID (none of them work)
        RequiredFieldValidator1.ErrorMessage = "select date";

    }

    protected void Button1_Click(object sender, EventArgs e)
    {

    }
}

MASTER PAGE:
=================

<%@ Master Language="C#" AutoEventWireup="true" CodeFile="MasterPage.master.cs" Inherits="MasterPage" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        &nbsp;<table border="0" cellpadding="0" cellspacing="0" style='width: 100%; height: 100%'>
            <tr>
                <td colspan="2" style='height: 7px'>
                    header</td>
            </tr>
            <tr>
                <td style='width: 200px; height: 533px'>
                    left</td>
                <td style='height: 533px'>
        <asp:contentplaceholder id="ContentPlaceHolder1" runat="server">
        </asp:contentplaceholder>
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    foo</td>
            </tr>
        </table>
    </div>
    </form>
</body>
</html>

MASTER PAGE CODE BEHIND:
======================

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class MasterPage : System.Web.UI.MasterPage
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
}


Its all about coding!
0
nisarkhan
9/8/2006 1:18:08 PM
lostlander:

Where is the validator located?

If it's located in the content page, so you may set the ControlToValidate property in Page_Load as:

validateCtrl.ControlToValidate = ((TextBox)Master.FindControl("ControlID")).ClientID

If it's in masterpage, i'm afraid it should work smoothly, at least, it works for me. Try to do some independent test.

Hope it helps!^_^

 here is my code very simple:

ASCX - WEB USERCONTROL:
=================
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ucDatePicker.ascx.cs" Inherits="ucDatePicker" %>
<asp:TextBox runat="server" ID="TextBox1"></asp:TextBox>

ASCX.CS - WEB USERCONTROL:
=================

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Telerik.WebControls;


public partial class ucDatePicker : System.Web.UI.UserControl
{
    public TextBox textbox
    {
        get
        {
            return TextBox1;
        }
    }
}


ASPX :
=================

<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="Default3.aspx.cs" Inherits="Default3" Title="Untitled Page" %>
<%@ Register Src="ucDatePicker.ascx" TagName="ucDatePicker" TagPrefix="uc1" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
    <td valign="top" class="text">
        <uc1:ucDatePicker ID="UcDatePicker1" runat="server" />
        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="RequiredFieldValidator"></asp:RequiredFieldValidator>
    </td>
</tr>
</table>
</asp:Content>

ASPX.CS:
=================

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Telerik.WebControls;
public partial class Default3 : System.Web.UI.Page
{
    public ContentPlaceHolder content;

    protected void Page_Load(object sender, EventArgs e)
    {
        RequiredFieldValidator1.ControlToValidate = UcDatePicker1.textbox.ID; // I HAVE TRIED CLIENTID, UNIQUIEID, ID (none of them work)
        RequiredFieldValidator1.ErrorMessage = "select date";

    }

    protected void Button1_Click(object sender, EventArgs e)
    {

    }
}

MASTER PAGE:
=================

<%@ Master Language="C#" AutoEventWireup="true" CodeFile="MasterPage.master.cs" Inherits="MasterPage" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        &nbsp;<table border="0" cellpadding="0" cellspacing="0" style='width: 100%; height: 100%'>
            <tr>
                <td colspan="2" style='height: 7px'>
                    header</td>
            </tr>
            <tr>
                <td style='width: 200px; height: 533px'>
                    left</td>
                <td style='height: 533px'>
        <asp:contentplaceholder id="ContentPlaceHolder1" runat="server">
        </asp:contentplaceholder>
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    foo</td>
            </tr>
        </table>
    </div>
    </form>
</body>
</html>

MASTER PAGE CODE BEHIND:
======================

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class MasterPage : System.Web.UI.MasterPage
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
}


Its all about coding!
0
nisarkhan
9/8/2006 1:18:09 PM

oops sorry for the duplicate posts:

 also i have tried like this but no luck:

if (content == null) content = (ContentPlaceHolder)Page.Master.FindControl("ContentPlaceHolder1");

RequiredFieldValidator1.ControlToValidate = ((ucDatePicker)content.FindControl("UcDatePicker1")).ClientID;

i removed the requriedfieldvalidator and run the page to see what ID i'm getting so here is the viewsource of the aspx page:

//view source of the .aspx page:
=======================
start
=====
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head><title>
     Untitled Page
</title></head>
<body>
    <form name="aspnetForm" method="post" action="Default3.aspx" id="aspnetForm">
<div>
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwULLTIxMDg1MjQ3NzVkZKYLgVKZBksH3L4eggPrE7UDVotb" />
</div>

    <div>
        &nbsp;<table border="0" cellpadding="0" cellspacing="0" style='width: 100%; height: 100%'>
            <tr>
                <td colspan="2" style='height: 7px'>
                    header</td>
            </tr>
            <tr>
                <td style='width: 200px; height: 533px'>
                    left</td>
                <td style='height: 533px'>
       
<table border="0" cellspacing="0" cellpadding="0">
<tr>
    <td valign="top" class="text" style='height: 24px'>
        <input name="ctl00$ContentPlaceHolder1$UcDatePicker1$TextBox1" type="text" id="ctl00_ContentPlaceHolder1_UcDatePicker1_TextBox1" />


 
     </td>
</tr>
</table>

                </td>
            </tr>
            <tr>
                <td colspan="2">
                    foo</td>
            </tr>
        </table>
    </div>
   
<div>

     <input type="hidden" name="__EVENTVALIDATION" id="__EVENTVALIDATION" value="/wEWAgKgh4G5BAKayuyDCCW6z5SvaoDuauWbAXQlR+yNKqBT" />
</div></form>
</body>
</html>
========


Its all about coding!
0
nisarkhan
9/8/2006 1:33:17 PM
in your validator trying adding ControlToValidate="textbox1"
0
darkempire7
9/8/2006 3:22:38 PM

I'm using master pages as well and I have a validator on 2 of my drop down and the only thing i did was drag and drop the validator to the page. I didn't have to do any of this stuff to validate the controls. I also did the same thing for my input page. which is also in the content page section.

 

I just did what darkemp stated, when dragging the validator over to the page. pick what control to validate and how to validate it, that was it.

interesting

0
IGotYourDotNet
9/8/2006 3:29:41 PM
IGotYourDotNet:

I'm using master pages as well and I have a validator on 2 of my drop down and the only thing i did was drag and drop the validator to the page. I didn't have to do any of this stuff to validate the controls. I also did the same thing for my input page. which is also in the content page section.

 

I just did what darkemp stated, when dragging the validator over to the page. pick what control to validate and how to validate it, that was it.

interesting

note: i'm validating my web usercontrol so there is difference between just control and a web user control

 


Its all about coding!
0
nisarkhan
9/8/2006 3:36:40 PM

darkempire7:
in your validator trying adding ControlToValidate="textbox1"

 

textbox1 is not a control

my texbox is inside the webuser control

so i'm validating web user control not just textbox control

 if you look at my post, i have posted my source code

why not just create a asp.net project and copy and paste the above code in the project so you will know exactly where i'm struggling ...

i have Google and not found single solution so far


Its all about coding!
0
nisarkhan
9/8/2006 3:41:12 PM
so are my drop downs, they're a user control. i'm looking at project now
0
IGotYourDotNet
9/8/2006 4:35:29 PM

ok here is what i did:

I took your project and put the validator on the actual user control and it validates the control.:

 code:

'web form 

<%@ Register Src="WebUserControl.ascx" TagName="WebUserControl" TagPrefix="uc1" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">

<uc1:WebUserControl ID="WebUserControl1" runat="server" />

<asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Button" />

</asp:Content>

'use control

<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>

<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="TextBox1"

ErrorMessage="RequiredFieldValidator"></asp:RequiredFieldValidator>

 'code behind on the web form. I'm only writing what text is entered into the text box.

protected void Button1_Click(object sender, EventArgs e)

{

WebUserControl web = new WebUserControl();

TextBox text = (TextBox)WebUserControl1.FindControl("TextBox1");

Response.Write(text.Text.ToString());

 

}

 

try it out

 

0
IGotYourDotNet
9/8/2006 5:00:51 PM
IGotYourDotNet:

I took your project and put the validator on the actual user control and it validates the control.:

 i know about that

but i dont want to put the validator inside the usercontrol

thats the trick here


Its all about coding!
0
nisarkhan
9/8/2006 6:41:00 PM
Reply:

Similar Artilces:

Unable to find control id 'rblXXX' referenced by the 'ControlToValidate' property of 'rfvXXX'.
I'm trying to add a dynamically created collection of requiredfieldvalidator controls to a gridview during Page_Load.  If I just add the rfv controls to the form it works fine but when I try to add them to a gridview control I get this error.  Here's my code: Working code: Just adds controls to form at bottom of pageFor Each c As Control In validators Form.Controls.Add(c) Next   Code causing error:For Each c As Control In validatorsDim gridView As GridView = Me.grvSectionA gridView.Rows(r).Cells(2).Controls.Add(c) r += 1 Next   Mark Gagnon...

Unable to find control id 'lbCountry2' referenced by the 'ControlToValidate' property of 'rfvSelectedCountry'.
Hello, I am trying to validate a listbox inside a control that is called like this from my page: <uc1:LinkedLists ID="llCountrySelector1" runat="server"></uc1:LinkedLists> This control is used at other places on the site so I cant add the validator in the control directly. The question is this, how can i put a required field validator on a list box inside this control? I tried this but got got the error in the message title: ' validationMe.rfvSelectedCountry.ControlToValidate = Me.llCountrySelector1.RightList.ID     if your problem is you only want to valida...

''''''''''''''''''''
Name: haznen Email: haznenatyahoodotcom Product: Gran Paradiso Alpha 8 Summary: '''''''''''''''''''' Comments: '''''''''''''''''''''''''''''''''''' Browser Details: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a1) Gecko/20061204 UGES/1.7.2.0 GranParadiso/3.0a1 From URL: http://www.mozilla.org/projects/granparadiso/ Note to readers: Hendrix gives...

'''''
Name: mario Email: ramar17atfastwebnetdotit Product: Gran Paradiso Alpha 2 Summary: ''''' Comments: K: Browser Details: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a2) Gecko/20070206 GranParadiso/3.0a2 ...

'do' won't 'do' if '/'
Greetings to All from Au, Have a NetWare Perl 5.8.4 and wanted to tweak File\Spec\NW.pm to try and standardise on '/' separators. If I run a test script (t/uni/lower.t) with an unmodified NW.pm, it calls t/uni/case.pl, that, in case.pl, (when the path separators are '\'), the $file is '..\lib\unicore\To\Lower.pl' and the following code portion works, with $simple getting a returned table: sub casetest { my ($base, $spec, $func) = @_; my $file = File::Spec->catfile(File::Spec->catdir(File::Spec->updir, "lib", &qu...

Could not find control '' in ControlParameter ''
Hello All I have a repeater with controls, some draw from different SqlDatasources. Everything loads up properly, I click my update button and then I get the error: "Could not find control 'txtProjectName' in ControlParameter 'projectName'" The Control txtProjectName is in the repeater <itemTemplate> <asp:TextBox ID="txtProjectName" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "projectName") %>' /> My Datasource that I want to update looks like this:  <asp:SqlDataSource ID="dsEditProject" runat="server" ConnectionString="<%$ ConnectionString...

'''
Name: L Lachowsky Email: e2brutus_10atyahoodotcom Product: Firefox Summary: ''' Comments: why duddn this surprise me... I change default server from IE to Mozilla, and then i get error messages. well, shud I decide to not get on my computer with Mozilla..or shud I risk security breeches with IE....hmmm at least i can get on the internet with IE Browser Details: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.0.5) Gecko/2008120122 Firefox/3.0.5 From URL: http://hendrix.mozilla.org/ Note to readers: Hendrix gives no expectation of a response to this fee...

Control 'chkbxEntreeList' referenced by the ControlToValidate property of 'cusValEntreeSelections' cannot be validated.
Can you not validate a checkboxlist or something?  Here's what I have: <tr><td><asp:CustomValidator Enabled="true" ID="cusValEntreeSelections" ControlToValidate="chkbxEntreeList" runat="server" onservervalidate="cusValEntreeSelections_ServerValidate" /></td></tr> <tr><td align="right" ><asp:CheckBoxList ID="chkbxEntreeList" TextAlign="right" RepeatColumns="2" RepeatLayout="Table" RepeatDirection="Vertical" runat="server"...

Control '{0}' referenced by the ControlToValidate property of '{1}' cannot be validated.
Hi At Page_Load lTotalRows gets a number. And if the user clicks on btDoSomething then the postback should kick in only if lTotalRows is less then ddlCount. But I get this error: Control 'lTotalRows' referenced by the ControlToValidate property of 'valcDoSomething' cannot be validated. Any idea why? <asp:literal id="lTotalRows" text="0" runat="server" /> <asp:dropdownlist id="ddlCount" runat="server">   <asp:listitem text="10" />   <asp:listitem text="20" />   <asp:listitem text="30" />   <asp:listitem text="4...

Cast from type ''''DBNull'''' to type ''''String'''' is not valid.
How do I avoid getting this error: Cast from type ''''DBNull'''' to type ''''String'''' is not valid. I am trying to get values from the database into a form for updating using a Datareader, SQL is set to allow nulls for certain fields as they are not required but the only way I can get the form to display is by adding a space in SQL. Is there another way around this? Check if it is equal to DBNull.Value first and if it is, don't do the cast.Stanley Tan theSpoke Blog Where in the code does it need to go? I am using the following and it's the profile that isn't always requi...

Control Id 'TextBox1' changes to 'ctl00_ContentPlaceHolder1_TextBox1'
Control Id 'TextBox1' changes to 'ctl00_ContentPlaceHolder1_TextBox1'  when viewed in page source. I can not get the value of my textbox in javascript because it can not find either 'TextBox1'  or 'ctl00_ContentPlaceHolder1_TextBox1'  . Master pages require Place holders so I am stuck with it, any ideas? That is because of INamingContainer. You'll need to use the ClientID property to get a reference to the ID rendered at runtime. i.e. TextBox1.ClientID RyanRyan OlshanASPInsider | Microsoft MVP, ASP.NEThttp://ryanolshan.comHow to ask a question Thanks mate it wor...

table_info('','','','%') cannot return any types
I was recently confirming table_info special cases and discovered the case for getting table_types cannot work. table_info('','','','%') should return a list of table types but it returns a list of empty strings instead: my @types = $h->tables('', '', '', '%'); print "all types:\n", join("xxx\n", @types), "\n"; # should output something like: # "dbo" # "INFORMATION_SCHEMA" # "sys" # and actually outputs: xxx xxx It seems to be down to the following ...

'Error Creating Control' ... 'true' could not be set on property 'ShowRadioButtons'
I have created a custom control which inherits from a compositeControl. Its all works well in the browser but when I show it in the design mode I geta gray box with the following message Error Creating Control - GroupPicker1'true' could not be set on property 'ShowRadioButtons'. The Property is a fairly standard get and set Public Property ShowRadioButtons() As Boolean            Get                Return rowRadioButtons.Visible  &nbs...

'or' or 'union'
Hello I was just wondering, in general what is better to use, an 'or' clause in a select or a 'union' to join two selects together. Do both statements create work tables? Many thanks Alex I think OR will be better than union. because suppose u have 3 tables and using OR u can join table a and table b and table c so each table will have only one read. but using union you will join table a and table b and in another query of union u will use table (a or b) and table c so ur one read is more in union . Ramdas Alex Cheung wrote: > Hello > >...

'IN' Clause or 'OR'
Hello, [1]: select * from TABLEA where COL1 IN('value1','value2''valu3'....) [2]:select * from TABLEA where COL1 = 'value1' OR COL1= 'value2' OR COL1='valu3'. TABLEA is a huge table and it has non-clustered index on COL1. Among the above 2 queries, which query will give me the better performance or fast response and WHY? What is the difference between 'IN' and 'OR' clauses as for as Sybase Optimization is concerned. Which is the better one to be used on huge tables. Thanks. Mac An IN list is treated as a series of OR clauses. There's no diff between the two as far as the optimizer is concerned. Eric Miner Sr. engineer Optimizer Group Ma wrote: > Hello, > > [1]: select * from TABLEA where COL1 IN('value1','value2''valu3'....) > > [2]:select * from TABLEA where COL1 = 'value1' OR COL1= 'value2' OR > COL1='valu3'. > > TABLEA is a huge table and it has non-clustered index on COL1. Among the > above 2 queries, which query will give me the better performance or fast > response and WHY? > > What is the difference between 'IN' and 'OR' clauses as for as Sybase > Optimization is concerned. Which is the better one to be used on huge > tables. > > Thanks. > Mac ...

'b'..'a'
Hello. I'm using defferent 5.6.0's for Win32. I wonder wheter following behaviour is intentional or not: d:\>perl -e "print 'b'..'c'" bc d:\>perl -e "print 'b'..'a'" bcdefghijklmnopqrstuvwxyz I expected empty list in latter case, like in perl -e "print 'bb'..'a'" <!ENTITY Vadim REALLIFE "Vadim V.Konovalov, St.Petersburg, Russia"> &Vadim; On Wed, Sep 20, 2000 at 03:14:41PM +0400, Konovalov, Vadim wrote: > Hello. > > I'm using defferent 5.6.0'...

Error: Unable to find control with id 'DropDownList1' that is associated with the Label 'Label1'
Here is my aspx:            <asp:Label ID="Label1" runat="server" Text="" AssociatedControlID="DropDownList1" >                <asp:DropDownList ID="DropDownList1" runat="server"  />            </asp:Label> Here is my code behind:    protected void Page_Load(object sender, EventArgs e)    {        L...

'System.Web.UI.Control.Context' denotes a 'property' where a 'class' was expected
I get the following error when trying to compile my project. The call to Context lies in a usercontrol. It works fine when called from a page, but how do I call it from a usercontrol? private User _currentUser = new User(Context.User.Identity.Name); 'System.Web.UI.Control.Context' denotes a 'property' where a 'class' was expected Firefox - The browser you can trust Update: private User _currentUser = new User(Context.User.Identity.Name);Is declared inside the class, not in a function. Like: public class Someclass : System.Web.UI.UserControl { private User _currentUser = new...

EXEC sp_msforeachtable 'sp_spaceused ''?'''
What does the following SQL code mean?  EXEC sp_msforeachtable 'sp_spaceused ''?'''Johan TheunissenMCPD, MCSE, MCTS BizTalk 2006==============================Please mark the most helpful reply/replies as "Answer". JohanNL:sp_msforeachtable This is the name of the SP that resides in the master database.  This SP executes one or more commands for a table. JohanNL:sp_spaceused This is the command that you want to run for each of the tables residing in your current database.  As you might have understood so far, that this is again a...

'To', 'CC', & 'BCC'
Name: Dick Tracy Email: philipdottracyatoptusnetdotcomdotau Product: Thunderbird Summary: 'To', 'CC', & 'BCC' Comments: I have just started using Thunderbird and while I find it quite excellent- I suggest having a button to add addressees to 'BCC' as well. Currently each 'BCC' addressee has to be selected manually. I send e-mail to quite a number of people at a time and I do not wish to readily spread others addresses easily. Browser Details: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.6) Gecko/20070725 Firefox/2.0....

'Value' should be between 'minimum' and 'maximum'.
I'm attempting to invoke with parameters:  Dim thing2 As New mydelsubPBStep(AddressOf pbStep) Me.Invoke(thing2, "setMax", dt.Rows.Count)      <---- this is where the error occurs   the delegate looks like this: Private Delegate Sub mydelsubPBStep(ByVal mode As String, ByVal value As Integer)   the function it's calling looks like this:Private Sub pbStep(ByVal mode As String, ByVal value As Integer) Select Case mode.ToLower Case "clear" ProgressBar1.Value = 0 Case "step" ProgressBar1.PerformStep() L...

Could not find control 'xxx' in ControlParameter 'yyy'
In a FormView, I'm trying to do an insert. One of the fields is to come from a drop downlist in the formview. Problem is I get an error message:Could not find control 'xxx' in ControlParameter 'yyy' Obviously, a problem with locating the dropdownlist control, but why? Any ideas? Is it anything to do with the fact that I organized it into a table?? <InsertItemTemplate> <table class="gridviewsmall" style="width: 100%;" border="3"> <tr><td class="maintext" style="text-align: center; font-size:x-large;" colspan="2">New Order</td></tr> <tr><td style="width: 60%"> <asp:table id="InsertTable" runat="server"> <asp:tablerow runat="server" id="ddUserOrdererRow">  <asp:tablecell runat="server" cssclass="editcolumnleft" id="ddUserOrdererLabel">Ordered By:</asp:tablecell>  <asp:tablecell runat="server" cssclass="editcolumnright">     <asp:DropDownList ID="ddUserOrderer_1" runat="server" DataSourceID="OrdererSqlDataSource_1" DataTextField="FullName" DataValueField="UserNumber" SelectedValue='<%# Bind("UserNumberWhoOrdered") %>'  Width="152px" /></asp:tablecell></asp:tablerow>....</table></td></tr></table><asp:SqlDataSource ID="OrdererSqlDataSource_1" runat="server" ConnectionString="<%$ ConnectionStrings: ZZZ %>" SelectCommand="ddGetAllUsers" SelectCommandType="StoredProcedure"><SelectParameters>...</Se...

Could not find control 'vd_ddl_SchoolID' in ControlParameter 'SchoolID'.
Any ideas why it can't find the control?  1 <asp:SqlDataSource 2 ID="ds_WorkOrder_dv" 3 runat="server" 4 ConnectionString="<%$ ConnectionStrings:MaintConnectionString %>" 5 ProviderName="<%$ ConnectionStrings:MaintConnectionString.ProviderName %>" 6 SelectCommand="SELECT * FROM [Work Orders] WHERE ([WorkOrderID] = ?)" 7 UpdateCommand="UPDATE [Work Orders] SET SchoolID = @SchoolID, Location = @Location, RequestedBy = @ReqBy 8 ,PriorityLevel = @Priority...

Could not find control 'JointRepresentationLettersRequired' in ControlParameter 'rbJointRepresentationLettersRequiredYes'.
I'm having problems getting the values from two radio buttons.  They are both named differently, and I want to pass their value into the same sql field, with a 1 for yes and a 0 for no.  Here's my code... How do I pass a 1 or a 0 into my stored procedure for the value of JointRepresentationLettersRequired.  <asp:RadioButton ID="rbJointRepresentationLettersRequiredYes" runat="server" AutoPostBack="true" GroupName="JointRepresentationLettersRequired" Text="Yes" /> <asp:RadioButton ID="rbJointRepre...

Web resources about - Unable to find control id 'TextBox1' referenced by the 'ControlToValidate' property of 'RequiredFieldValidator1'. - asp.net.navigation-controls

Resources last updated: 3/25/2016 1:09:00 AM