.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Adding Image to button created in VS 2005

Posted By:      Posted Date: October 27, 2010    Points: 0   Category :SharePoint


I am using C# and VS 2005. I am using the WSP Builder to create a web part feature.

I have created a button in the CreateChildControls. I want to add an Image to the button.

I would like to know, if this can be achieved.


btnMyBtn = new Button();
this.btnMyBtn.Style.Add(HtmlTextWriterStyle.BackgroundImage, "/Images/email_button_rnmp_opt.jpg");


In the folder structure, which gets created using the WSP Builder, there is no Images folder.  Is it possible to create a folder (for example: IMAGES) in the Solution Explorer, under Template.

How to add the image to the solution explorer, and under which folder, so that after building the application, the Image can be seen in the webpart.

Thank you

View Complete Post

More Related Resource Links

What would be the best way of adding a button that will only update a status of row from "Created" t



I am planning to add couple of custom buttons to update a status of a record in GridView?

What would be the best way of implementing it?

Many thanks, 

Gridview with Image Button


i have a gridview and i want to perform edit and delete with an image button

but unable to figure out the events and how i m gonna make my grid into edit mode ??

<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
                <asp:TemplateField HeaderText="S.No">
                        <asp:Label ID="Label1" runat="server" Text='<%# Container.DataItemIndex+1 %>'></asp:Label>
                <asp:TemplateField HeaderText="Edit">
                        <asp:ImageButton ID="ImageButton1" runat="server" ImageAlign="Middle" 
                            ImageUrl="~/image/ico_edit.gif" CommandName="Edit" 
                            onclick="ImageButton1_Click" />
                <asp:TemplateField HeaderText="Delete">

how to set multiple button in single image


Hi friends,

I need to make multiple button in a single image in asp.net.

and need coding also for vb.net.

thanx in advance

change image button image


i am making a web form with a VB code behind.  on the form I have a down arrow imageButton that when pressed hides certain data.  what i want to do is change the button to an up arrow and vice versa whenever pressed.  i have both images loaded onto my project already.  any suggestions.

thank you

Adding carriage returns between 2 dynamically created controls in an HtmlTableCell


The title pretty much explains it. Here is what i'm trying to do...

 Private Sub LoadGrid_CommentsField(ByVal Row As HtmlTableRow, ByVal BookingNumber As String, ByVal CommentsText As String)
  Dim Txt As TextBox
  Dim Cmd As ClickOnceButton.ClickOnceButton

  Txt = New TextBox
  Txt.ID = "txtComment_" & BookingNumber
  Txt.CssClass = "TFAppControls"
  Txt.TextMode = TextBoxMode.MultiLine
  Txt.MaxLength = 500
  Txt.Width = New Unit(95, UnitType.Percentage)
  Txt.Text = CommentsText

  Row.Cells(cComments).InnerHtml &= "<br/>"

  Cmd = New ClickOnceButton.ClickOnceButton
  Cmd.DisableAfterClick = True
  Cmd.Text = "Save Comments"
  Cmd.ID = "cmdSaveComments_" & BookingNumber
  Cmd.CssClass = "TFAppButtons"
  Cmd.EnableViewState = False
 End Sub

On the line where i try and update the InnerHtml, i get the following error; "Cannot get inner content of  because the contents are not literal."

Store Null Data In image datatype in sql server 2005



i wanted to store image in sqlserver database image field and i did. But now in some cases i want to store null value in that image field please let me know how to do this using file uploader.please give complete sample code.


Adding a button to the Report Portal

Hi everyone, I am using SSRS 2008 and would like to know if there is a way to customize the Report Portal?  I need to add a button that the user can click on when they find a bug or the report doesn't work.  The button would open an email window for the user to type in the problem they are experiencing and it would be sent to our Ontime system.      Thanks for your help!  Youngmon...  

How do I set CausesValidation=false on a button that was created with Javascript?

I have a button on an ASP.NET page, and that button is (and needs to be) created via Javascript. The problem is, there are some validators on the page, and pressing the button is causing them to fire, and I don't want that to happen in this particular case. I am not sure what CausesValidation=false actually does on the page, but I was hoping to re-create it somehow.I have been trying to locate the button by using a FindControl() statement in code-behind, but that doesn't seem to be working. If it did, I could just set the CausesValidation there...Any thoughts?

Open in new window option for Image Button

I am using an Image Button with onclientclick property set.Upon clicking the button I am able to navigate to URL page. But when I am right clicking on the Image Button I am not getting "Open in new window" or "Open in new tab". These options I see when I right click on an Hyperlink control.Can we achieve the same fro Image Button. If so how?Thank you,Praveen.

image as a button

hi alli would like to use an image i created with web button maker as a button in my formwhere do i put the postback action for the button?thank you

play storyboard with dynamically created image

this is my storyboard:   <Storyboard x:Key="expandStoryboard"> <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleX" To="2" Duration="0:0:0.2" /> <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleY" To="2" Duration="0:0:0.2" /> </Storyboard> <!-- This storyboard will make the image revert to its original size --> <Storyboard x:Key="shrinkStoryboard"> <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleX" To="1" Duration="0:0:0.2" /> <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleY" To="1" Duration="0:0:0.2" /> </Storyboard>   and i created image dynamically:   BitmapImage bmp = new BitmapImage(); bmp.BeginInit(); bmp.UriSource = new Uri("file:///" + arrstrFileNames[0].Replace("\\", "/")); bmp.EndInit(); Image img = new Image(); img.Source = bmp; RotateTransform rt = new RotateTransform(); img.LayoutTransform = rt; ScaleTransform st = new ScaleTransform(); st.ScaleX = 1; st.ScaleY = 1; img.LayoutTransform = st; if(first==true) img.ContextMenu = mnu; first = false; assignEv

Change image button image on hover

Hoep this si simple I would like to change the image in an image button when the user hovers over it ..can anyone helpThanks  

image button click in listview with scriptmanager

 I am using scriptmanager in masterpage and my imagebutton click event is not being found in code behind and my javascript is not working and no events are firing. In fact, the imagebutton does not change the mouse icon to a hand when hovering... help!  <asp:UpdatePanel ID="upTabControl" runat="server" UpdateMode="Conditional"> <Triggers> <asp:AsyncPostBackTrigger ControlID="tabControlScriptManagerTabStrip" /> <asp:PostBackTrigger ControlID="scriptManagerTabStripMultiPage" /> <asp:AsyncPostBackTrigger ControlID="ctrl_List_View_Images1$lv_Items_Images" /> <asp:AsyncPostBackTrigger ControlID="ContractDocumentUpload1" /> </Triggers> <ContentTemplate> <telerik:RadTabStrip ID="tabControlScriptManagerTabStrip" runat="server" SelectedIndex="0" Skin="Web20" MultiPageID="scriptManagerTabStripMultiPage" AutoPostBack="True" OnTabClick="RadTabStrip1_TabClick"> <Tabs> <telerik:RadTab Text="Blog" runat="server" MultiPageID="scriptManagerMultiPag

Adding a Cancel Button

Hi, I have an application that performs a very big algorithm when a button is clicked. I'm trying to add a "Cancel Button" if the user wants to cancel the operation. The problem is the cancel button doesn't fire any event while the program is executing another events. Actually it seems beeing inactive. Any idea of how can I solve the problem?

Your upgrade is blocked.. when adding components to SQL 2005 Standard Edition SP1

Name: Microsoft SQL Server 2005 Tools Hello, I am having a problem when trying to add the Client Components to an existing installation of SQL 2005 Standard Edition SP1 running on Windows 2003 Standard. The server was originally built with SQL 2005 Standard Edition and had SP1 installed at a later date. I am using the CD that SQL was originally installed with which is not a service packed copy of SQL. The reason given when clicking the details button is as follows: Reason: Your upgrade is blocked. For more information about upgrade support, see the "Version and Edition Upgrades" and "Hardware and Software Requirements" topics in SQL Server 2005 Setup Help or SQL Server 2005 Books Online. Build version check: Your upgrade is blocked because the existing component is a later version than the version you are trying to upgrade to. To modify an existing SQL Server component, go to Add or Remove Programs in Control Panel, select the component you would like to modify, and then click Change/Remove. Any help would be greatly appreciated. Regards Steve

dynamically created button control click event not firing first time?

HI im creating a button control in page int and im assing a click event for the button control. here the click event is not firing for the first time.can anyone help me with this? here is my code. Button btn = new Button(); btn.ID = "btn"; btn.Click += new EventHandler(btn_Click); Panel1.Controls.Add(btn); Panel1.Controls.Add(new LiteralControl(""));

adding an external image dynamically

hi Folks, i got a report with an image, the full qualified image is stored in an attribute like http://vmt-moss/Immo/NA23/NA23.jpg if I set the the property in SQL 2008 R1 RS to external and the value to imagepath (where the http link is stored) nothing doesn't been displayed. Additonally i am setting an Action to the image property, where also the imagepath value has been set, if click onto the image, image has been opened properly. Do I have to format the value to a Url Format ?   thx for your help
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend