Click here to Skip to main content
15,885,435 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
page.aspx.cs
imgUpAdd.visibl is true by default
C#
protected void Page_Load(object sender, EventArgs e)
   {
       Page.Form.Attributes.Add("enctype", "multipart/form-data");
   }

C#
protected void btnUpdate_Click(object sender, EventArgs e)
    {
        txtCatNum.Text=Grid.SelectedRow.Cells[1].Text;
        txtCantName.Text = Grid.SelectedRow.Cells[2].Text;
        txtDescription.Text = Grid.SelectedRow.Cells[3].Text;
        txtCatNum.ReadOnly = true;
        ImgUPAdd.Visible = true;
        ImgUPAdd.ImageUrl = "../../CatImgs"+txtCatNum.Text+"jpg";
        MultiView1.ActiveViewIndex = 1;
    }


C#
protected void btnAdd_Click(object sender, EventArgs e)
   {
       MultiView1.ActiveViewIndex = 1;
       txtCantName.Text = "";
       txtCatNum.Text = "";
       txtDescription.Text = "";
      ImgUPAdd.Visible = false;
       txtCatNum.ReadOnly = false;
       txtCatNum.Text = Cat.GetNextCatNo();
   }


EDIT AL: From Comments
page.aspx
ASP.NET
<asp:ScriptManager ID="ScriptManager1" runat="server">

<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<Triggers>
<asp:PostBackTrigger ControlID="btnSave" />
</Triggers>

<br />
<asp:MultiView ID="MultiView1" runat="server" ActiveViewIndex="0">
<br />
<asp:View ID="View1" runat="server">
<table align="center" cellpadding="3" cellspacing="4" class="style1" dir="ltr">
<tr>
<td class="style3">
                                                 
<asp:Label ID="Label1" runat="server" Font-Names="Impact" Font-Size="Large" 
Text="Search Products Categories">
                                                     
</td>
</tr>
<tr>
<td class="style3">
 <asp:Label ID="Label2" runat="server" Font-Names="Impact" Font-Size="Large" 
style="text-align: left" Text="search by:">
<asp:RadioButtonList ID="rdoField" runat="server" RepeatDirection="Horizontal">
<asp:ListItem Selected="True" Value="CatNo">Category Number
<asp:ListItem Value="CatName">Category Name

</td>
</tr>
<tr>
<td class="style3">
<asp:Label ID="Label3" runat="server" Font-Names="Impact" Font-Size="Large" 
Text="Value to Search">
<asp:TextBox ID="TxtSearch" runat="server">
<asp:Button ID="BtnSearch" runat="server" Height="33px" Text="Search" 
Width="85px" onclick="BtnSearch_Click" />
</td>
</tr>
<tr>
<td class="style3">
<asp:Button ID="btnAdd" runat="server" onclick="btnAdd_Click" Text="Add Item" />
<asp:Button ID="btnUpdate" runat="server" Enabled="False" Text="Update" 
onclick="btnUpdate_Click" />
<asp:Button ID="BtnRemove" runat="server" Enabled="False" 
style="text-align: right" Text="Remove " onclick="BtnRemove_Click" />
</td>
</tr>
<tr>
<td class="style3">
<asp:Label ID="LblMessage" runat="server" ForeColor="#CC3300">
                                                        
</td>
Posted
Updated 10-Sep-15 0:16am
v4
Comments
BasmaSH 10-Sep-15 6:10am    
page.aspx
https://drive.google.com/file/d/0B_e9Mrxyuj9DMHV3ZVRCOFRUU00/view?usp=sharing

page.aspx.cs
https://drive.google.com/file/d/0B_e9Mrxyuj9DaC1aUDJyQXllTHM/view?usp=sharing
ZurdoDev 10-Sep-15 7:41am    
Debug your code and you'll see why it is not visible. And why did you post the markup that doesn't have the image in it? What is the value of it?

1 solution

Hi BasmaSH,

For USP:Image like

<ASP:Image id="myImage" Visibile="True" ImgUrl="link" runat="server">


it's work like default true.

and you can also visibility false by using in code behind on run time also

i hope it's help full to you
thanks
Uttam katariya
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900