Showing posts with label class. Show all posts
Showing posts with label class. Show all posts

Thursday, March 29, 2012

html hyperlink

I have an html that I made to a hyperlink. this is the code

HTML
<SPAN class="Hyperlink"><A id="CP" runat="server">Client List</A></SPAN>
Code
CP.HRef = "Index.aspx?Page=ClientList"

Now the thing I want to do is when I click it I want to clear all my session variables. Is there any suggestionsWhy not create a linkbutton and in the code behind, have it clear the sessions,
then redirect to the page you want?

Zath
yes use the linkbutton and put this code to clear the sessions:


Session.Clear();
Response.Redirect("myotherpage.aspx");

Monday, March 26, 2012

HTML entity utility class

Does anyone know of a class or component that maps to and fromHTML entities?

That is, I can pass to it the string "Green Eggs & Ham" and have returned "Green Eggs & Ham", and visa-versa?

Thanks to anyone who can save me the effort of having to type in all these entities myself...

Saturday, March 24, 2012

HTML Email

Hello,
I am using the system.net.mail class to send out email in HTML
format. I have a few images in the HTML page. In order to have the
images display without referencing the server, attaching the images to
the email and calling the image like - '<img src='email2.jpg'> works
fine to me (atleast in an internal network).
I keep reading in the posts that when an email is sent to
yahoo/hotmail accnt, the images does not show up. I believe, it is an
option/setup thing? Let me know if i am wrong or missing something.
I am trying to find if I can test this on a external mail server
(just to make sure it actually works). It would be great if anybody has
any pointers? I was unable to find a mail server which accepts a mail
generated programmatically. I understand it is got to do with open
relays.
Thanks,
Sam

HTML Email

Hello,
I am using the system.net.mail class to send out email in HTML
format. I have a few images in the HTML page. In order to have the
images display without referencing the server, attaching the images to
the email and calling the image like - '<img src='http://pics.10026.com/?src=email2.jpg'works
fine to me (atleast in an internal network).
I keep reading in the posts that when an email is sent to
yahoo/hotmail accnt, the images does not show up. I believe, it is an
option/setup thing? Let me know if i am wrong or missing something.
I am trying to find if I can test this on a external mail server
(just to make sure it actually works). It would be great if anybody has
any pointers? I was unable to find a mail server which accepts a mail
generated programmatically. I understand it is got to do with open
relays.

Thanks,
Sam

Wednesday, March 21, 2012

HTML call const value

I have a constants.vb file with the following:

Public Class Constants
Public Const strRedAsterisk As String = "<font color=""#FF3300"">*</font>"
End Class

I have a login.aspx page. In html I have code:


<TD width="25%">Login ID <%# Constants.strRedAsterisk%></TD>

I get an error? I response.write Constants.strRedAsterisk in behind code and it works.

How can I call it in HTML ?Hi,

Try this :

<TD width="25%">Login ID <%=Constants.strRedAsterisk%></TD>

HTH
No doesn't work.

I get error:

BC30456: 'strRedAsterisk' is not a member of 'Microsoft.VisualBasic.Constants'.

I don't get it.
I put it in another class file called class1.

error message:

Name 'Class1' is not declared.

In code behind of aspx page - it works... But not when I call it in html view page. Do I have to set something on the top of the page?
Hi,

Use namespace as below :


<TD width="25%">Login ID <%=YourApplicationNameSpace.Constants.strRedAsterisk%></TD>

HTH
Awesome. Thanks

Is there a command line I can use so it inherits namespace and I don't have to put namespace in front of constants?
Also what if my applicationname changes later on down the road. Isn't it better not to use namespace ?