Click here to Skip to main content
15,881,204 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: Embedded image in portable area not showing on deployment Pin
AumSingh25-Nov-11 22:07
professionalAumSingh25-Nov-11 22:07 
GeneralRe: Embedded image in portable area not showing on deployment Pin
jkirkerx26-Nov-11 6:48
professionaljkirkerx26-Nov-11 6:48 
GeneralRe: Embedded image in portable area not showing on deployment Pin
AumSingh26-Nov-11 7:40
professionalAumSingh26-Nov-11 7:40 
GeneralRe: Embedded image in portable area not showing on deployment Pin
jkirkerx26-Nov-11 12:33
professionaljkirkerx26-Nov-11 12:33 
GeneralRe: Embedded image in portable area not showing on deployment Pin
AumSingh26-Nov-11 17:13
professionalAumSingh26-Nov-11 17:13 
GeneralRe: Embedded image in portable area not showing on deployment Pin
jkirkerx26-Nov-11 19:35
professionaljkirkerx26-Nov-11 19:35 
GeneralRe: Embedded image in portable area not showing on deployment Pin
AumSingh27-Nov-11 6:05
professionalAumSingh27-Nov-11 6:05 
GeneralRe: Embedded image in portable area not showing on deployment Pin
jkirkerx27-Nov-11 8:51
professionaljkirkerx27-Nov-11 8:51 
Please accept my apology.

I get frustrated sometimes, and probably should of just been more direct. On the other forum, I just ignore the questions now, and don't get involved anymore.

Diagnostics:
Sometimes you have to work backwards, and look at the final results in the browser output. If the results don't work, you have to pick it apart. So you start at the image tag, inspect the url. test the url in the browser bar.

There's a ton of information in the browser source, it just takes some learning to read the info and understand it. If you code in CSharp, then the principals are the same.

Now you work forward on the source, to make adjustments to what is sent back to the browser.

The most common mistakes I see is in the use of Client Script Manager, and not registering the CS in OnInit. The 2nd mistake is not using CS WebResuorceUrl as the url in the image tag. The image url is a webresource.

Sample Code in vb. This is for you to just get an idea of the stucture and use of of the client script manager, and the webresource url.

VB
Protected Overrides Sub OnInit(ByVal e As System.EventArgs)
       MyBase.OnInit(e)

       Controls.Clear()

       Dim cs As ClientScriptManager = Me.Page.ClientScript
       Dim rsType As Type = Me.GetType()

       Select Case [Localization]
           Case 0
               rm = New ResourceManager("Admin_PP_Standard.labels_en", Assembly.GetExecutingAssembly())
               ci = New CultureInfo("en-US")
           Case 1
               rm = New ResourceManager("Admin_PP_Standard.labels_fr", Assembly.GetExecutingAssembly())
               ci = New CultureInfo("fr-CA")
           Case 2
               rm = New ResourceManager("Admin_PP_Standard.labels_es", Assembly.GetExecutingAssembly())
               ci = New CultureInfo("es-MX")
       End Select

       Dim Comment As LiteralControl
       Comment = New LiteralControl
       Comment.Text = "<!-- SignUp V1.1 for ASP.NET 4.0 -->" & vbCrLf
       Controls.Add(Comment)

       Dim img_Name As String = Nothing
       Dim img_Email As String = Nothing
       Dim img_ProgressIndicator As String = Nothing
       Dim img_Connect As String = Nothing
       Dim img_BG_ModalProgress As String = Nothing

       Select Case [Page_ColorTheme]
           Case 0  'Light
               img_Name = cs.GetWebResourceUrl(rsType, "Footer_SignUp.ico-form_person_light.png")
               img_Email = cs.GetWebResourceUrl(rsType, "Footer_SignUp.ico-form_envelope.png")
               img_ProgressIndicator = cs.GetWebResourceUrl(rsType, "Footer_SignUp.modalProgress32.gif")
               img_Connect = cs.GetWebResourceUrl(rsType, "Footer_SignUp.btn-send_it_on_connect.png")
               img_BG_ModalProgress = cs.GetWebResourceUrl(rsType, "Footer_SignUp.modal_ProgressIndicator.png")
           Case 1  'Dark
               img_Name = cs.GetWebResourceUrl(rsType, "Footer_SignUp.ico-form_person.png")
               img_Email = cs.GetWebResourceUrl(rsType, "Footer_SignUp.ico-form_envelope.png")
               img_ProgressIndicator = cs.GetWebResourceUrl(rsType, "Footer_SignUp.modalProgress32.gif")
               img_Connect = cs.GetWebResourceUrl(rsType, "Footer_SignUp.btn-send_it_on_connect.png")
               img_BG_ModalProgress = cs.GetWebResourceUrl(rsType, "SmartWeb.ContactUs.modal_ProgressIndicator.png")
           Case Else
               img_Name = cs.GetWebResourceUrl(rsType, "Footer_SignUp.ico-form_person.png")
               img_Email = cs.GetWebResourceUrl(rsType, "Footer_SignUp.ico-form_envelope.png")
               img_ProgressIndicator = cs.GetWebResourceUrl(rsType, "Footer_SignUp.modalProgress32.gif")
               img_Connect = cs.GetWebResourceUrl(rsType, "Footer_SignUp.btn-send_it_on_connect.png")
               img_BG_ModalProgress = cs.GetWebResourceUrl(rsType, "SmartWeb.ContactUs.modal_ProgressIndicator.png")
       End Select

ib_Connect = New ImageButton
        With ib_Connect
            .ID = [ID] & "_ib_Connect"
            .ImageAlign = ImageAlign.Left
            .ImageUrl = img_Connect
            '.OnClientClick = "javascript:OverlayProgressPanel()"
            'AddHandler .Click, AddressOf ib_Connect_Click
        End With
        td_Connect.Controls.Add(ib_Connect)




The 3rd mistake I see is not registering the embedded material in the assemblyInfo.

XML
<Assembly: WebResource("Footer_SignUp.btn-send_it_on_connect.png", "image/png")>
<Assembly: WebResource("Footer_SignUp.ico-form_envelope.png", "image/png")>
<Assembly: WebResource("Footer_SignUp.ico-form_person.png", "image/png")>


The 4th mistake is not using the proper root namespace.
root namespace.imagefilename.extension

Right click your project in ssolution explorer, , select the application tab, at the top, you'll see your Assembly Name and Root Namespace.

The 5th mistake is not declaring the right mimetype in the AssemblyInfo. "image/png"

Now you have the page lifecycle. These are the basic building blocks.

OnPreRender - Really special purpose - You don't need it
OnInit - Create the server controls, and builds the page in server memory as htmltextwriter
OnLoad - Populate the server controls with data. - Override for Page.Load
Render - Write out the htmltextwriter, and send to either design mode or browser window.

////////////////////////////////////////////////////////////////////////////////////////
CreateChildControls - Called automatically, but you can override it
OnLoad - called automatically - but you can override it.

Solution:

You can private message me your browser source, so I can see the end results. Or point me to a url where I can see the html output.

Or you can send me a sample of your code module, so I can see what you have going.
QuestionAJAX ENABLED WEBSITE IN VS 2010 Pin
Member 322226425-Nov-11 2:03
Member 322226425-Nov-11 2:03 
AnswerRe: AJAX ENABLED WEBSITE IN VS 2010 Pin
Not Active25-Nov-11 3:15
mentorNot Active25-Nov-11 3:15 
AnswerRe: AJAX ENABLED WEBSITE IN VS 2010 Pin
jkirkerx25-Nov-11 19:20
professionaljkirkerx25-Nov-11 19:20 
GeneralRe: AJAX ENABLED WEBSITE IN VS 2010 Pin
Member 322226426-Nov-11 0:40
Member 322226426-Nov-11 0:40 
GeneralRe: AJAX ENABLED WEBSITE IN VS 2010 Pin
jkirkerx26-Nov-11 7:16
professionaljkirkerx26-Nov-11 7:16 
GeneralRe: AJAX ENABLED WEBSITE IN VS 2010 Pin
Member 322226428-Nov-11 0:05
Member 322226428-Nov-11 0:05 
QuestionWeb Service input validation in WSDL Pin
umairmoghal23-Nov-11 21:53
umairmoghal23-Nov-11 21:53 
AnswerRe: Web Service input validation in WSDL Pin
jkirkerx24-Nov-11 8:56
professionaljkirkerx24-Nov-11 8:56 
Questionshowing crystal report with query string parameter Pin
sk_ko23-Nov-11 16:11
sk_ko23-Nov-11 16:11 
AnswerRe: showing crystal report with query string parameter Pin
thatraja23-Nov-11 17:03
professionalthatraja23-Nov-11 17:03 
GeneralRe: showing crystal report with query string parameter Pin
sk_ko23-Nov-11 17:22
sk_ko23-Nov-11 17:22 
AnswerRe: showing crystal report with query string parameter Pin
thatraja23-Nov-11 19:20
professionalthatraja23-Nov-11 19:20 
GeneralRe: showing crystal report with query string parameter Pin
sk_ko24-Nov-11 14:56
sk_ko24-Nov-11 14:56 
AnswerRe: showing crystal report with query string parameter Pin
thatraja24-Nov-11 15:05
professionalthatraja24-Nov-11 15:05 
GeneralRe: showing crystal report with query string parameter Pin
sk_ko24-Nov-11 15:44
sk_ko24-Nov-11 15:44 
AnswerRe: showing crystal report with query string parameter Pin
thatraja24-Nov-11 18:19
professionalthatraja24-Nov-11 18:19 
QuestionHow to fill several comboboxes with for loop? Pin
symeramon23-Nov-11 4:01
symeramon23-Nov-11 4:01 

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.