Click here to Skip to main content
15,887,875 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: Designing templates Pin
4anusha412-Aug-09 2:42
4anusha412-Aug-09 2:42 
QuestionUsercontrol+placeholder Pin
Ramkumar_S12-Aug-09 1:31
Ramkumar_S12-Aug-09 1:31 
AnswerRe: Usercontrol+placeholder Pin
Mike Ellison12-Aug-09 2:29
Mike Ellison12-Aug-09 2:29 
Questionhebrew and mail Pin
polycom12312-Aug-09 1:21
polycom12312-Aug-09 1:21 
AnswerRe: hebrew and mail Pin
Abhishek Sur12-Aug-09 4:09
professionalAbhishek Sur12-Aug-09 4:09 
QuestionUpdate panel problem Pin
muniratnam12-Aug-09 1:20
muniratnam12-Aug-09 1:20 
AnswerRe: Update panel problem Pin
4anusha412-Aug-09 1:22
4anusha412-Aug-09 1:22 
GeneralRe: Update panel problem Pin
muniratnam12-Aug-09 1:40
muniratnam12-Aug-09 1:40 
Default.aspx
----------

<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<!-- Site Container -->
<asp:UpdatePanel ID="UpdatePanel" runat="server">
<ContentTemplate>

<div>
<asp:PlaceHolder ID="PlaceHolder_content" runat="server"></asp:PlaceHolder>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<!-- /Site Container -->
</form>
</body>


Default.aspx.cs
---------------

public string page;
protected void Page_Load(object sender, EventArgs e)
{

PlaceHolder_content.Controls.Clear();
CompareScheme CompareScheme_Ctrl = (CompareScheme)LoadControl("CompareScheme.ascx");
PlaceHolder_content.Controls.Add(CompareScheme_Ctrl);
}



CompareScheme.ascx (user COntrol)
-------------------

<div class="find_fund" style="padding-left: 10px; padding-top: 10px;">
<div class="find_top">
<div class="topnews_label">
Compare Schemes</div>
</div>
<div class="find_middle1">
<div class="LH" style="margin-left: 1px; margin-right: 1px;">
<table cellpadding="0" cellspacing="0" border="0" width="100%" >
<tr>
<td>
Select Category
</td>
<td>
<asp:DropDownList ID="ddl_category" style="width:250px; font-size: 12px; color: #828282; padding-left: 6px;" runat="server" AutoPostBack="True"
OnSelectedIndexChanged="ddl_category_SelectedIndexChanged">
</asp:DropDownList>
</td>
</tr>
<tr>
<td>
Select Scheme1
</td>
<td>
<asp:DropDownList ID="ddl_scheme1" style="width:250px; font-size: 12px; color: #828282; padding-left: 6px;" Width="250px" runat="server">
</asp:DropDownList>
</td>
</tr>
<tr>
<td>
Select Scheme2
</td>
<td>
<asp:DropDownList ID="ddl_scheme2" style="width:250px; font-size: 12px; color: #828282; padding-left: 6px;" runat="server">
</asp:DropDownList>
<span>
<asp:Button ID="btn_Go" runat="server" style="background-image:url(/images/btnbg.gif);color:#FFFFFF;border:none;background-repeat:no-repeat;width:86px;height:26px;font-family: Arial;font-size:11px;font-weight:bold;cursor:pointer;" Text="GO" OnClick="btn_Go_Click" /></span>
</td>
</tr>
<tr>
<td><asp:Label ID="lbl_warning" runat="server" Text=""></asp:Label></td>
</tr>
<tr>
<td style="height:10px;"></td>
</tr>

<tr>
<td id="tabs" runat="server" colspan="2">
</td>
</tr>
</table>
</div>
</div>
<div class="find_bottom">
&nbsp;</div>
</div>


CompareScheme.ascx.cs
---------------------
protected void Page_Load(object sender, EventArgs e)
{
if (clevent != "post")
fillcategory();
}

private void fillcategory()
{
MF.DS = MF.DAL_Mut_Category();
ddl_category.DataSource = MF.DS;
ddl_category.DataValueField = "SCHCLCODE";
ddl_category.DataTextField = "SCHCLASS";
ddl_category.DataBind();
ListItem li = new ListItem("Select a Category", "");
ddl_category.Items.Insert(0, li);

ListItem li1 = new ListItem("Select a Scheme", "");
ddl_scheme1.Items.Insert(0, li1);

ListItem li2 = new ListItem("Select a Scheme", "");
ddl_scheme2.Items.Insert(0, li2);

}

protected void ddl_category_SelectedIndexChanged(object sender, EventArgs e)
{
clevent = "post";
MF.Str_Category = ddl_category.SelectedValue;
MF.DAL_Mut_Schemes();

ddl_scheme1.DataSource = MF.DS;
ddl_scheme1.DataValueField = "mf_schcode";
ddl_scheme1.DataTextField = "SCH_name";
ddl_scheme1.DataBind();

ddl_scheme2.DataSource = MF.DS;
ddl_scheme2.DataValueField = "mf_schcode";
ddl_scheme2.DataTextField = "SCH_name";
ddl_scheme2.DataBind();
}

Here the problem is i am having an Default.aspx page

In that i am loading CompareScheme.ascx user coltrol into the place holder
here if i select first dropdownlist the other two dropdownlist are loaded based on the first one selection...

I am getting loadded the second two dropdownlists only if i select two times...

--------------------------------------------------------


second is consider i am having a gridview in the usercontrol,


like this

this is an usercontrol


------------------

<asp:UpdatePanel ID="Updatepan" runat="server" UpdateMode="Conditional" RenderMode="Inline">
<ContentTemplate>
<div class="top_funds">
<div class="funds_top">
<div class="topnews_label">
Top Funds
</div>
<div style="float: left;" class="topnews_label">
<span style="font-family: Arial; color: Navy; font-size: 13px; font-weight: bold;">
<asp:UpdateProgress ID="updateprogress" AssociatedUpdatePanelID="Updatepan" runat="server">
<ProgressTemplate>
Loading...
</ProgressTemplate>
</asp:UpdateProgress>
</span>
</div>
</div>
<div class="funds_middle" style="height: 100%">
<div style="width: 500px;">
<asp:GridView ID="GV_types" GridLines="None" Width="502px" CellPadding="5" PageSize="5"
AllowPaging="true" runat="server" AutoGenerateColumns="false">
<Columns>
<asp:TemplateField HeaderStyle-Width="200px" HeaderText="Scheme Name">
<ItemTemplate>
<asp:LinkButton ID="lnk" CommandArgument='<%#DataBinder.Eval(Container.DataItem, "Mf_SchCode").ToString()%>'
OnCommand="lnkbtn_Click" runat="server"><%#DataBinder.Eval(Container.DataItem, "SCH_NAME").ToString()%></asp:LinkButton>
</ItemTemplate>
<ItemStyle Width="200px" CssClass="tbl_fontsize blue_Clr" />
</asp:TemplateField>
<asp:BoundField DataField="NavRs" DataFormatString="{0:N}" HeaderText="NAV(Rs)">
<ItemStyle Width="50px" />
<ItemStyle Width="50px" CssClass="tbl_fontsize" />
</asp:BoundField>
<asp:BoundField DataField="week1" DataFormatString="{0:N}" HeaderText="1wk">
<ItemStyle Width="35px" />
<ItemStyle Width="35px" CssClass="tbl_fontsize" />
</asp:BoundField>
<asp:BoundField DataField="month1" DataFormatString="{0:N}" HeaderText="1m">
<ItemStyle Width="35px" />
<ItemStyle Width="35px" CssClass="tbl_fontsize" />
</asp:BoundField>
<asp:BoundField DataField="month3" DataFormatString="{0:N}" HeaderText="3m">
<ItemStyle Width="35px" />
<ItemStyle Width="35px" CssClass="tbl_fontsize" />
</asp:BoundField>
<asp:BoundField DataField="month6" DataFormatString="{0:N}" HeaderText="6m">
<ItemStyle Width="35px" />
<ItemStyle Width="35px" CssClass="tbl_fontsize" />
</asp:BoundField>
<asp:BoundField DataField="year1" DataFormatString="{0:N}" HeaderText="1y">
<ItemStyle Width="35px" />
<ItemStyle Width="35px" CssClass="tbl_fontsize" />
</asp:BoundField>
</Columns>
<PagerSettings Mode="NextPrevious" NextPageText="Next" PreviousPageText="Prev" />
<HeaderStyle CssClass="gray_color" Height="10px" />
<RowStyle BackColor="#FFFFFF" ForeColor="#000000" Font-Names="Arial" Height="10px"
Font-Size="11px" />
<AlternatingRowStyle BackColor="#F8F8F8" ForeColor="#000000" Height="10px" Font-Names="Arial"
Font-Size="11px" />
</asp:GridView>

</div>

</div>
<div class="funds_bottom">
&nbsp;</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>



protected void Page_Load(object sender, EventArgs e)
{

//if(!IsPostBack)
loadschemes();
}


private void loadschemes()
{


MF.DS = MF.DAL_Mut_TopFun_Category();
GV_schemes.DataSource = MF.DS;
GV_schemes.DataBind();
}




protected void GV_schemes_PageIndexChanging(object sender, GridViewPageEventArgs e)
{
GV_schemes.PageIndex = e.NewPageIndex;

loadschemes();
}

------------------------

in the gridview the paging is woking only if i click two times...
QuestionRestricting GridView.ImageField size for image display Pin
Chesnokov Yuriy12-Aug-09 1:03
professionalChesnokov Yuriy12-Aug-09 1:03 
AnswerRe: Restricting GridView.ImageField size for image display Pin
Mike Ellison12-Aug-09 2:28
Mike Ellison12-Aug-09 2:28 
GeneralRe: Restricting GridView.ImageField size for image display Pin
Chesnokov Yuriy12-Aug-09 3:02
professionalChesnokov Yuriy12-Aug-09 3:02 
GeneralRe: Restricting GridView.ImageField size for image display Pin
Mike Ellison12-Aug-09 14:50
Mike Ellison12-Aug-09 14:50 
AnswerRe: Restricting GridView.ImageField size for image display Pin
Abhijit Jana12-Aug-09 4:19
professionalAbhijit Jana12-Aug-09 4:19 
QuestionRe: Restricting GridView.ImageField size for image display Pin
Chesnokov Yuriy12-Aug-09 19:43
professionalChesnokov Yuriy12-Aug-09 19:43 
AnswerRe: Restricting GridView.ImageField size for image display Pin
Abhijit Jana13-Aug-09 1:06
professionalAbhijit Jana13-Aug-09 1:06 
GeneralRe: Restricting GridView.ImageField size for image display Pin
Chesnokov Yuriy13-Aug-09 3:22
professionalChesnokov Yuriy13-Aug-09 3:22 
GeneralRe: Restricting GridView.ImageField size for image display Pin
galvin verghese11-Nov-11 23:38
galvin verghese11-Nov-11 23:38 
QuestionData Table Pin
KhandelwalA12-Aug-09 0:48
KhandelwalA12-Aug-09 0:48 
AnswerRe: Data Table Pin
Mike Ellison12-Aug-09 2:26
Mike Ellison12-Aug-09 2:26 
AnswerRe: Data Table Pin
Abhishek Sur12-Aug-09 2:45
professionalAbhishek Sur12-Aug-09 2:45 
Question!postback Pin
Ramkumar_S12-Aug-09 0:45
Ramkumar_S12-Aug-09 0:45 
AnswerRe: !postback Pin
padmanabhan N12-Aug-09 0:47
padmanabhan N12-Aug-09 0:47 
GeneralRe: !postback Pin
Ramkumar_S12-Aug-09 1:19
Ramkumar_S12-Aug-09 1:19 
AnswerRe: !postback Pin
Venkatesh Mookkan12-Aug-09 16:24
Venkatesh Mookkan12-Aug-09 16:24 
GeneralRe: !postback Pin
Ramkumar_S13-Aug-09 1:50
Ramkumar_S13-Aug-09 1:50 

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.