ASP membership send registration HTML mail with image - html

i have ASP.NET site with membership provider. when the user is registered i send mail for registration compilation with .txt file (containing HTML). i trying to add image to this HTML. the problem is that i cant see any image in the mail. 'images' folder is under main site folder.
Confermation.txt file
<body style='text-align:right;font-family:arial'>
<div style='margin:0 auto'>
<img id="Image1" src="images/logo.png" style="width:350px;" />
<br />
please press the following link<br />
<br />
press here
<br /><br />
Thanks
</div>
ASP.NET
<asp:CreateUserWizard runat="server" EnableViewState="False"
DisableCreatedUser="True" ID="CreateUserWizard1" Width="300px
OnSendingMail="CreateUserWizard_SendingMail">
<LayoutTemplate>
<asp:PlaceHolder ID="wizardStepPlaceholder" runat="server"></asp:PlaceHolder>
<asp:PlaceHolder ID="navigationPlaceholder" runat="server"></asp:PlaceHolder>
</LayoutTemplate>
<CreateUserButtonStyle CssClass="btnRegister" Height="35px"></CreateUserButtonStyle>
<MailDefinition From="myemail#gmail.com"
IsBodyHtml="True" Subject="registration" BodyFileName="Confermation.txt">
</MailDefinition>
<WizardSteps>
why cant i see the image?
i tried also src="logo.png" and src="../images/logo.png" with no success.

you are adding html(browser type) coding in txt(simple text file) file. That can't be run or understand by browser. Use mail type html that can solve you problem

Related

Hyperlink doesn't redirect to View from same project

I want to redirect from one view to another view in the same project/solution. There are 3 hyperlinks in here and I am unable to redirect to either of them. Can someone help me with this?
<body>
<div>
<br />
<span style="margin-left:20%"></span>
Forgot Login ID?
<br />
<br /><span style="margin-left:20%"></span>
Forgot Password?
<br />
<br />
<span style="margin-left:20%"></span>
Need to register your Corporation?
Click here
</div>
</body>
When I try to click on the hyperlink, I am getting the following HTTP 404 Not Found error. I tried many approaches, but none seem to work.
I tried different approaches to linking to the controller. But, I failed to get any positive output.
Asp.net does not have phyiscal routing - you do not want to link to physical files. Instead it resolves its routes after a pattern. The default pattern, unless specified otherwise is "{controller}/{action}/{id}".
So assuming your controller is called CorporationController, and your action method is called "ForgotPassword", the hyperlink would be constructed with:
#Html.ActionLink("Forgot Password", "ForgotPassword", "Corporation")
You might want to read some basic documentation about Asp.Net Mvc first.

my target frame does not open within my page, instead it opens in a separate window/tab. What gives?

Use Case: displaying info in a subset window of the SAME page the user is in. For example. I have a list on the left side. On the right side is details of a record based on what data point is clicked on the left. Currently I am trying to use an iframe tag. Both parent and target iframe are content from my single same domain/site i.e. there is no external sources I'm referencing.
I've had this iframe working in the past, then one day I went to check it out and it was not working as it should.
So the parent page has a list of students (in the left column).
The target iframe (right column) is supposed to show the students details one the students link is clicked in the parent page.
Instead what it's doing now, is opening a whole new tab in a separate window with the students details.
UPDATE: Jan16, 2018
So i tested it in four browsers. Only Safari apparently supports the inwindow target render. Chrome, Opera and Firefox all opened new tabs - not what i want. What gives? Here is the full html (I realized I should grab the source vs what my front end html looks like in Wordpress... sorry).
<p><iframe id="ifrm" src="http://example/wp-admin/admin.php?page=wpbc&wh_approved&wh_is_new=1&wh_booking_date=3&view_mode=vm_listing" width="100%" height="400">Your school has not setup a booking listings view. Please speak to your school or contact admin to have it set up.
</iframe></p>
<p>Welcome Instructor. This is your personal Dashboard.
<p><strong>School Name:</strong> School name <br />
<strong>Your ID:</strong> instructor3</p>
<hr />
<div class="fivecol-one"><strong>Student ID:</strong> user<br />
<a href="http://example/frm_display/Instructor-dashboard-iframe?student=453369" target="myiframe">View Details in window<br />
</a></p>
<hr />
<p> <strong>Student ID:</strong> jan17<br />
<a href="http://example/frm_display/Instructor-dashboard-iframe?student=45988" target="myiframe">View Details in window<br />
</a></p>
<hr />
<p> <strong>Student ID:</strong> user2<br />
<a href="http://example/frm_display/Instructor-dashboard-iframe?student=44499" target="myiframe">View Details in window<br />
</a></p>
<hr />
<p> <strong>Student ID:</strong> jstudent<br />
<a href="http://example/frm_display/Instructor-dashboard-iframe?student=464428" target="myiframe">View Details in window<br />
</a></p>
<hr />
<p> </p>
</div>
<div class="fivecol-four last">
<iframe id="myiframe" scrolling="yes" frameborder="1" src="http://example/frm_display/Instructor-dashboard-iframe/" height="500px" width="100%">
</div>
<div class="clear"></div>
So you can see that I have named my iframe id="myiframe" and my target="myiframe". I did notice that i had forgotten to close the iframe tag in the target, however, that did not seem to make a difference. I cleared my cache and refreshed my pages.
As mentioned it's working in Safari desktop only. HOWEVER, (and this is weird) in mobile, it's working in ALL browsers! (i removed my explicative..what was i thinking)
I don't know if this is applicable, but this site is hosted in Wordpress and using formidable forms. In particular the iframe is displaying what's called in formidable a 'view' i.e. a special page that shows data from formidable. It's not formally a 'page' in the Wordpress sense of the meaning. Hence I'm wondering if for some reason the iframe tag is getting confused. One suggestion was to use
in the header of the iframe page. And that's when i realized i can't apparently do that because as far as I know a formidable 'view' does not have a header?
HELP!!! please.
this is embarrassing.
I was simply missing a name attribute
name="myIframe"
wow... sorry for posting bone head move, but hope it can help someone.

new document dialog showing master page header images

I have a SharePoint team site and I made some changes in master page as below:
Moved top menu links and search box below page heading
In place of top links I placed an image called image1 and in place of search box I placed another image called image2
Replacing SharePoint logo with my own logo and increasing its size
I did all this using DIV/CSS. Now I am no designer, not even close. So I had to do a lot of trial and error before every thing looked ok except this one issue which now I am facing and i.e. when you click on "new document" link which opens a dialog box where you can upload document, that window is also showing those logos (which I mentioned in point 2 above)
How can I get rid of that? I was thinking that if somehow I can find out if the dialog is open then I can hide those images using CSS/Jquery?
Here's partial code to given you and understanding where I have wrote code. My divs are named "mydiv" and "mydiv2" while rest of the code is SharePoint's default:
<div id="WebPartAdderUpdatePanelContainer">
<asp:UpdatePanel
ID="WebPartAdderUpdatePanel"
UpdateMode="Conditional"
ChildrenAsTriggers="false"
runat="server">
<ContentTemplate>
<WebPartPages:WebPartAdder ID="WebPartAdder" runat="server" />
</ContentTemplate>
<Triggers>
<asp:PostBackTrigger ControlID="WebPartAdder" />
</Triggers>
</asp:UpdatePanel>
</div>
</SharePoint:AjaxDelta>
</div>
</div>
<div id="s4-workspace" class="ms-core-overlay">
<div id="mydiv" style="float:left;border:thin;border-style:none;width:210px;position:absolute; padding-top:20px;padding-bottom:0px;padding-left:200px;z-index:1;">
<img src="/images/image1.jpg" width="65%" height="65%"></div>
<div id="mydiv2" style="border: thin none currentColor; width: 250px; right:600px;position:absolute; padding-top:20px; padding-bottom:10px;float: right;z-index:1;">
<img src="/images/image2.jpg" width="800" height="56">
</div>
<div id="s4-bodyContainer">
<div id="s4-titlerow"
class="ms-dialogHidden s4-titlerowhidetitle">
<div id="titleAreaBox"
class="ms-noList ms-table ms-core-tableNoSpace">
<div id="titleAreaRow"
class="ms-tableRow">
Fixed by using CSS class ms-dialogHidden as mentioned here:
https://sharepoint.stackexchange.com/questions/200195/new-document-dialog-showing-master-page-header-images/200197#200197

Image not show asp.net

If I run my webapplication the application work right. When I try to publish with the file system the images doesn't show. The images are included in project and in the publish folder I do find the images in the image folder.
but is does not show. There is no error, so I do not know where I had to look. Does somebody can help me with this? The image is a simple html tag.
<img src="~/Images/logo.png">
You can not mix ~ with non runat="server" control :
But you can do this :
<img src='<%= ResolveUrl("~/Images/logo.png") %>'/>
MVC :
<img src="#Url.Content("~/Images/logo.png" )"
Is it an ASP.NET webform project? If so, update it as follows:
<img src="~/Images/logo.png" runat="server" />
Here are two ways to set up your image. Either one should work for you.
<img src="/Images/logo.png" />
<asp:Image ID="Image1" ImageUrl="~/Images/logo.png" runat="server" />

adding / to internet address causes asp:Image not loading

My code:
<asp:Image runat="server" alt="not loaded" ImageUrl="picture.png" />
On site address
example.com/tabid/233/Default.aspx
everything works, but on address ("/" added)
example.com/tabid/233/Default.aspx/
my page looks like before but picture is not loaded. Does somebody can explain it to me and give an adive what to do to have picture always loaded?
If image in root u can map image like this.
<asp:Image runat="server" alt="not loaded" ImageUrl="~/picture.png" />
Default.aspx is your page and Default.aspx/ references to a folder. If you want to use / at the and, you can try routing or apply rewrite rules.
http://msdn.microsoft.com/en-us/magazine/dd347546.aspx
Change the "ImageUrl" attribute in the Image tag to something like...
<asp:Image runat="server" ImageUrl="~/picture.png" />
The extra "/" has the browser looking a folder deeper than it should be for the image.