Click here to Skip to main content
16,004,901 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: Website created in VS2005,want to publish in IIS5.1 Pin
bishwambhar_sen19-Feb-09 21:00
bishwambhar_sen19-Feb-09 21:00 
GeneralRe: Website created in VS2005,want to publish in IIS5.1 Pin
Vimalsoft(Pty) Ltd19-Feb-09 21:04
professionalVimalsoft(Pty) Ltd19-Feb-09 21:04 
Questiongetting textbox text from client back to server side Pin
marky77719-Feb-09 2:55
marky77719-Feb-09 2:55 
AnswerRe: getting textbox text from client back to server side Pin
lobbychmd19-Feb-09 4:13
lobbychmd19-Feb-09 4:13 
GeneralRe: getting textbox text from client back to server side Pin
marky77719-Feb-09 20:39
marky77719-Feb-09 20:39 
AnswerRe: getting textbox text from client back to server side Pin
Mark Graham19-Feb-09 4:32
Mark Graham19-Feb-09 4:32 
GeneralRe: getting textbox text from client back to server side Pin
marky77719-Feb-09 21:23
marky77719-Feb-09 21:23 
QuestionError : Databinding methods such as Eval(), XPath(), and Bind() can only be used in the context of a databound control. Pin
Amol12345519-Feb-09 2:44
Amol12345519-Feb-09 2:44 
Following is my userdefined Template as CoreVocabularyFields.ascx

<%@ Control Language="C#" ClassName="CoreVocabularyFields" %>

<script language="C#" runat="server">

    public void PopulateCoreType(object sender, EventArgs e)
    {
        EntityDropDownList list = (EntityDropDownList)FormUtil.FindControl(((Control)sender).NamingContainer, "dataCoreTypeId");
        CoreTypeDataSource datasource = (CoreTypeDataSource)FormUtil.FindControl(((Control)sender).NamingContainer, "CoreTypeIdCoreTypeDataSource");
               
        if (list != null)
        {
            list.DataSource = datasource;
            list.DataTextField = "NetTypeName";
            list.DataValueField = "Id";
            list.DataBind();
        }          
    }
</script>

<asp:FormView ID="FormView10" runat="server">
	<ItemTemplate>
		<table border="0" cellpadding="3" cellspacing="1">
			<tr>
                <td class="literal"><asp:Label ID="lbldataTerm" runat="server" Text="Term:" AssociatedControlID="dataTerm" /></td>
                <td>
					<asp:TextBox runat="server" ID="dataTerm" Text='<%# Bind("Term") %>'  TextMode="MultiLine"  Width="250px" Rows="5"></asp:TextBox><asp:RequiredFieldValidator ID="ReqVal_dataTerm" runat="server" Display="Dynamic" ControlToValidate="dataTerm" ErrorMessage="Required"></asp:RequiredFieldValidator>
				</td>
			</tr>
			<tr>
                <td class="literal"><asp:Label ID="lbldataCoreTypeId" runat="server" Text="Core Type Name:" AssociatedControlID="dataCoreTypeId" /></td>
                <td>
					<table border="0">
					    <tr>					        <td valign="middle" style="width:100px;">
					            <data:EntityDropDownList runat="server" ID="dataCoreTypeId" DataSourceID="CoreTypeIdCoreTypeDataSource" DataTextField="JavaTypeName" DataValueField="Id" SelectedValue='<%# Bind("CoreTypeId") %>' AppendNullItem="true" Required="true" NullItemText="< Please Choose ...>" ErrorText="Required" />
					            <data:CoreTypeDataSource ID="CoreTypeIdCoreTypeDataSource" runat="server" SelectMethod="GetAll"  />
					        </td>
					        <td valign="top">
					            <table>
					                <tr>
					                    <td><font style="color:Gray; font-weight:bold;">Select By :</font></td>
					                    <td><asp:RadioButton AutoPostBack="true" ID="JavaType" GroupName="CoreType" runat="server" OnCheckedChanged="PopulateCoreType" Checked="true" /></td>
					                    <td><font style="color:Gray; font-weight:bold;">JavaTypeName</font></td>
					                    <td><asp:RadioButton AutoPostBack="true" ID="NetType" GroupName="CoreType" OnCheckedChanged="PopulateCoreType" runat="server" /></td>
					                    <td><font style="color:Gray; font-weight:bold;">NetTypeName</font></td>
					                </tr>
					            </table>
					        </td>
					    </tr>
					</table>
				</td>
				<td>
				    <%--<asp:Button runat="server" OnClientClick="return showHideCoreTypeBlock();" Text="Add New Core Type" ID="btnAddCoreType" CausesValidation="false" />--%>
				    <div id="divAddCoreType" style="display:none;">
		                <data:MultiFormView ID="FormView2" DataKeyNames="Id" runat="server" DataSourceID="CoreTypeDataSource" DefaultMode="Insert">
		
			                <EditItemTemplatePaths>
				                <data:TemplatePath Path="~/Admin/UserControls/CoreTypeFields.ascx" />
			                </EditItemTemplatePaths>
                		
			                <InsertItemTemplatePaths>
				                <data:TemplatePath Path="~/Admin/UserControls/CoreTypeFields.ascx" />
			                </InsertItemTemplatePaths>
                		
			                <EmptyDataTemplate>
				                <b>CoreType not found!</b>
			                </EmptyDataTemplate>
                			
			                <FooterTemplate>
				                <asp:Button ID="InsertButton" runat="server" CausesValidation="False" CommandName="Insert" Text="Insert" />
				                <asp:Button ID="CancelButton" runat="server" CausesValidation="False" CommandName="Cancel" Text="Cancel" />
			                </FooterTemplate>

		                </data:MultiFormView>
                    		
		                <data:CoreTypeDataSource ID="CoreTypeDataSource" runat="server" SelectMethod="GetAll" />
				    </div>
				</td>
			</tr>
			<tr>
                <td class="literal"><asp:Label ID="lbldataMeaning" runat="server" Text="Meaning:" AssociatedControlID="dataMeaning" /></td>
                <td>
					<asp:TextBox runat="server" ID="dataMeaning" Text='<%# Bind("Meaning") %>'  TextMode="MultiLine"  Width="250px" Rows="5"></asp:TextBox><asp:RequiredFieldValidator ID="ReqVal_dataMeaning" runat="server" Display="Dynamic" ControlToValidate="dataMeaning" ErrorMessage="Required"></asp:RequiredFieldValidator>
				</td>
			</tr>
			
		</table>

	</ItemTemplate>
</asp:FormView>


In the above code I want to change the DataTextField of the DropDownList(Id: dataCoreTypeId) on the OnCheckedChanged event of the Radio Button
(Having Text as JavaType Name and NetType Name)

I am using this template in the CoreVocabulary.aspx page inside MultiFormView Tag

<%@ Page Language="C#" Theme="Default" MasterPageFile="~/MasterPages/admin.master" AutoEventWireup="true"  CodeFile="CoreVocabularyEdit.aspx.cs" Inherits="CoreVocabularyEdit" Title="CoreVocabulary Edit" %>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder2" Runat="Server">Core Vocabulary - Add/Edit</asp:Content>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
		<data:MultiFormView ID="FormView1" DataKeyNames="Id" runat="server" DataSourceID="CoreVocabularyDataSource">
		
			<EditItemTemplatePaths>
				<data:TemplatePath Path="~/Admin/UserControls/CoreVocabularyFields.ascx" />
			</EditItemTemplatePaths>
		
			<InsertItemTemplatePaths>
				<data:TemplatePath Path="~/Admin/UserControls/CoreVocabularyFields.ascx" />
			</InsertItemTemplatePaths>
		
			<EmptyDataTemplate>
				<b>CoreVocabulary not found!</b>
			</EmptyDataTemplate>
			
			<FooterTemplate>
				<asp:Button ID="InsertButton" runat="server" CausesValidation="True" CommandName="Insert" Text="Insert" />
				<asp:Button ID="UpdateButton" runat="server" CausesValidation="True" CommandName="Update" Text="Update" />
				<asp:Button ID="CancelButton" runat="server" CausesValidation="False" CommandName="Cancel" Text="Cancel" />
			</FooterTemplate>

		</data:MultiFormView>
		
		<data:CoreVocabularyDataSource ID="CoreVocabularyDataSource" runat="server"
			SelectMethod="GetById"
		>
			<Parameters>
				<asp:QueryStringParameter Name="Id" QueryStringField="Id" Type="String" />
			</Parameters>
		</data:CoreVocabularyDataSource>
</asp:Content>     


But when I click the radio button I got the error as

Databinding methods such as Eval(), XPath(), and Bind() can only be used in the context of a databound control.


Thanks
Questionhow can pictures and video store in data base? Pin
ali2k619-Feb-09 2:25
ali2k619-Feb-09 2:25 
Questionproblem in transaction . Pin
souravghosh1819-Feb-09 1:41
souravghosh1819-Feb-09 1:41 
AnswerRe: problem in transaction . Pin
Mark Graham19-Feb-09 4:43
Mark Graham19-Feb-09 4:43 
QuestionDal Exception Pin
Mogaambo19-Feb-09 1:25
Mogaambo19-Feb-09 1:25 
AnswerRe: Dal Exception Pin
Vimalsoft(Pty) Ltd19-Feb-09 3:52
professionalVimalsoft(Pty) Ltd19-Feb-09 3:52 
QuestionBase64 Decoding for Thermal Printer [modified] Pin
premchand197519-Feb-09 1:25
premchand197519-Feb-09 1:25 
QuestionModal popup Pin
krishna2gubbala19-Feb-09 0:21
krishna2gubbala19-Feb-09 0:21 
AnswerRe: Modal popup Pin
Calin Tatar19-Feb-09 2:32
Calin Tatar19-Feb-09 2:32 
AnswerRe: Modal popup Pin
Mark Graham19-Feb-09 4:22
Mark Graham19-Feb-09 4:22 
Questionpassing values from aspx page to htm page Pin
venu65619-Feb-09 0:13
venu65619-Feb-09 0:13 
AnswerRe: passing values from aspx page to htm page Pin
Greg Chelstowski19-Feb-09 0:39
Greg Chelstowski19-Feb-09 0:39 
GeneralRe: passing values from aspx page to htm page Pin
venu65619-Feb-09 0:59
venu65619-Feb-09 0:59 
GeneralRe: passing values from aspx page to htm page Pin
Greg Chelstowski19-Feb-09 1:03
Greg Chelstowski19-Feb-09 1:03 
GeneralRe: passing values from aspx page to htm page Pin
venu65619-Feb-09 1:10
venu65619-Feb-09 1:10 
QuestionProblem With dropdownlist. Pin
Deepak Nigam18-Feb-09 23:49
Deepak Nigam18-Feb-09 23:49 
QuestionServer time and local time Pin
yesu prakash18-Feb-09 23:40
yesu prakash18-Feb-09 23:40 
AnswerRe: Server time and local time Pin
keyur satyadev19-Feb-09 3:07
keyur satyadev19-Feb-09 3:07 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.