Showing posts with label guys. Show all posts
Showing posts with label guys. Show all posts

Saturday, March 24, 2012

The default page is only showing HTML when copied to Host.

Hi Guys,

I'm working on a little site for a friend (my first!) I've been viewing in browser and everything is going fine, but when I copy the site to the hoster for further development all I'm seeing is html. I'm usingwww.streamline.com as the host, I have all the settings correct (I think), and I have set the webconfig file debug to false.

So, what am I doing wrong.

below is the code from the masterpage. (yes, I'm sure it's messy, but I haven't done the css yet).

<%@dotnet.itags.org. Master Language="VB" CodeFile="MasterPage.master.vb" Inherits="MasterPage" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head runat="server"> <title>Untitled Page</title></head><body bgcolor="#bdd8ea"> <form id="form1" runat="server"> <div> <table border="0" cellpadding="0" cellspacing="0" style="z-index: 100; left: 60px; width: 850px; position: absolute; top: 13px; height: 370px;"> <tr> <td align="left" style="background-color: #ffffff; width: 850px; height: 3px;" valign="top"> <p align="center" class="MsoNormal" style="margin: 0cm 0cm 0pt; text-align: center"> <span style="font-size: 24pt; color: #3300ff; font-family: Arial;"></span> </p> <p align="center" class="MsoNormal" style="margin: 0cm 0cm 0pt; text-align: center">  </p> <p align="center" class="MsoNormal" style="margin: 0cm 0cm 0pt; text-align: center">  </p> </td> </tr> <tr> <td align="left" style="background-color: #ffffff; width: 850px; height: 31px;" valign="top"> <table border="0" cellpadding="0" cellspacing="0" style="z-index: 100; left: 1px; width: 99.5%; position: absolute; top: 137px"> <tr> <td align="left" style="width: 109px; background-color: #099ccf; height: 30px;" valign="bottom"> </td> <td align="left" style="background-color: #099ccf; height: 30px; font-weight: bold; font-size: 15pt; color: #ffffff; font-family: 'Microsoft Sans Serif'; vertical-align: middle; width: 554px; text-align: left;" valign="bottom"> <asp:Literal ID="Literal1" runat="server"></asp:Literal></td> <td align="left" style="background-color: #099ccf; height: 30px;" valign="bottom"> </td> </tr> </table> <table border="0" cellpadding="0" cellspacing="0" style="z-index: 101; left: 0px; width: 100%; position: absolute; top: 168px; border-left-width: thin; border-left-color: #ffffff;"> <tr> <td align="left" style="border-top: #099ccf 2px solid; width: 3px; height: 288px; background-color: #ffffff" valign="top"> </td> <td align="left" style="border-top: #099ccf 2px solid; width: 122px; height: 288px; background-color: #ffffff; text-align: right;" valign="top"> <table border="0" cellpadding="0" cellspacing="0" style="z-index: 100; left: 3px; width: 100%; position: absolute; top: 5px; height: 189px;"> <tr> <td align="center" style="border-bottom: #ffffff 2px solid; background-color: #ffffff" valign="middle"> <a href="default.aspx" onmouseover="document.images.pic1.src='Images/Home_Over.gif'" onmouseout="document.images.pic1.src='Images/Home_Out.gif'"> <img src="Images/Home_Out.gif" name="pic1" border="0"></a> </td> </tr> <tr> <td align="center" style="border-bottom: #ffffff 2px solid; background-color: #ffffff" valign="middle"> <a href="Services.aspx" onmouseover="document.images.pic2.src='Images/Services_Over.gif'" onmouseout="document.images.pic2.src='Images/Services_Out.gif'"> <img src="Images/Services_Out.gif" name="pic2" border="0"></a> </td> </tr> <tr> <td align="center" style="border-bottom: #ffffff 2px solid; background-color: #ffffff" valign="middle"> <a href="CurrentProjects.aspx" onmouseover="document.images.pic3.src='Images/CurrentProjects_Over.gif'" onmouseout="document.images.pic3.src='Images/CurrentProjects_Out.gif'"> <img src="Images/CurrentProjects_Out.gif" name="pic3" border="0"></a> </td> </tr> <tr> <td align="center" style="border-bottom: #ffffff 2px solid; background-color: #ffffff" valign="middle"> <a href="FutureProjects.aspx" onmouseover="document.images.pic4.src='Images/FutureProjects_Over.gif'" onmouseout="document.images.pic4.src='Images/FutureProjects_Out.gif'"> <img src="Images/FutureProjects_Out.gif" name="pic4" border="0"></a> </td> </tr> <tr> <td align="center" style="border-bottom: #ffffff 2px solid; background-color: #ffffff" valign="middle"> <a href="Gallery.aspx" onmouseover="document.images.pic5.src='Images/Gallery_Over.gif'" onmouseout="document.images.pic5.src='Images/Gallery_Out.gif'"> <img src="Images/Gallery_Out.gif" name="pic5" border="0"></a> </td> </tr> <tr> <td align="center" style="border-bottom: #ffffff 2px solid; background-color: #ffffff" valign="middle"> <a href="Testimonials.aspx" onmouseover="document.images.pic6.src='Images/Testimonials_Over.gif'" onmouseout="document.images.pic6.src='Images/Testimonials_Out.gif'"> <img src="Images/Testimonials_Out.gif" name="pic6" border="0"></a> </td> </tr> <tr> <td align="center" style="border-bottom: #ffffff 2px solid; background-color: #ffffff" valign="middle"> <a href="UsefulLinks.aspx" onmouseover="document.images.pic7.src='Images/UsefulLinks_Over.gif'" onmouseout="document.images.pic7.src='Images/UsefulLinks_Out.gif'"> <img src="Images/UsefulLinks_Out.gif" name="pic7" border="0"></a> </td> </tr> <tr> <td align="center" style="background-color: #ffffff" valign="middle"> <a href="ContactUs.aspx" onmouseover="document.images.pic8.src='Images/ContactUs_Over.gif'" onmouseout="document.images.pic8.src='Images/ContactUs_Out.gif'"> <img src="Images/ContactUs_Out.gif" name="pic8" border="0"></a> </td> </tr> </table> </td> <td align="left" style="width: 10px; height: 288px; background-color: #ffffff; border-top: #099ccf 2px solid; border-left: #099ccf 1px solid;" valign="top">  </td> <td align="left" style="width: 473px; height: 288px; background-color: #ffffff; border-top: #099ccf 2px solid; font-size: 10pt; color: buttonshadow; font-family: 'Microsoft Sans Serif';" valign="top">  <br /> <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server"> </asp:ContentPlaceHolder> </td> <td align="left" style="width: 10px; height: 288px; background-color: #ffffff; border-right: #099ccf 2px solid; border-top: #099ccf 2px solid;" valign="top">  </td> <td align="left" style="width: 155px; height: 288px; background-color: #ffffff" valign="top"> </td> </tr> <tr> <td align="left" style="width: 3px; height: 20px; background-color: #ffffff; border-top-width: 2px; border-top-color: #099ccf;" valign="top">  </td> <td align="left" style="width: 122px; height: 20px; background-color: #ffffff; text-align: right; border-top-width: 2px; border-top-color: #099ccf;" valign="top"> </td> <td align="left" style="width: 10px; height: 20px; background-color: #ffffff; border-top-width: 2px; border-top-color: #099ccf; border-left: #099ccf 1px solid;" valign="top"> </td> <td align="left" style="border-top-width: 2px; width: 473px; border-top-color: #099ccf; height: 20px; background-color: #ffffff" valign="top"> </td> <td align="left" style="border-right: #099ccf 2px solid; width: 10px; height: 20px; background-color: #ffffff; border-top-width: 2px; border-top-color: #099ccf;" valign="top">  </td> <td align="left" style="width: 155px; height: 20px; background-color: #ffffff" valign="top"> </td> </tr> <tr> <td align="left" height="3" style="width: 3px; background-color: #ffffff" valign="top"> </td> <td align="left" height="3" style="width: 122px; background-color: #ffffff" valign="top"> </td> <td align="left" height="3" style="width: 10px; background-color: #ffffff" valign="top"> </td> <td align="left" height="3" style="width: 473px; background-color: #ffffff" valign="top"> </td> <td align="left" height="3" style="width: 10px; background-color: #ffffff" valign="top"> </td> <td align="left" height="3" style="width: 155px; background-color: #ffffff" valign="top"> </td> </tr> <tr> <td align="left" style="width: 3px; background-color: #bdd8ea" valign="top"> </td> <td align="left" style="width: 122px; background-color: #bdd8ea" valign="top"> </td> <td align="left" style="width: 10px; background-color: #bdd8ea" valign="top"> </td> <td align="left" style="width: 473px; background-color: #bdd8ea; text-align: center;" valign="top"> <span style="color: dimgray"><span style="font-size: 8pt"><span style="font-family: Arial"><span style="color: dimgray; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-GB; mso-fareast-language: EN-GB; mso-bidi-language: AR-SA"><strong style="vertical-align: middle">? </strong></span>T and S Wilson 2007/2008</span></span></span></td> <td align="left" style="width: 10px; background-color: #bdd8ea" valign="top"> </td> <td align="left" style="width: 155px; background-color: #bdd8ea" valign="top"> </td> </tr> </table> </td> </tr> </table> </div> </form></body></html>

Most likely ASP.NET is not setup on the site. Check with the host to be sure the site is on an IIS server running the version of ASP.NET (2.0|3.5) that you have built the site with. Most likely they have not setup ASP.NET on the server.


Thanks. They only open 10am til 4pm gmt so I'll ask them tomorrow.


I don't think you host provides .Net, or if they do .. most probably not 2.0/3.5


Looks like Streamline is a merchant company, not a hosting company.


What is the difference, they offer hosting?


Yes, they charged me an extra 35 quid for the ASP.NET framework, still only 4.5 quid a month though, so not bad.

Ta!


Sorry for my ignorance, but what is a quid in relation to a pound? I know a pound is a little more than a US $ and a pence is similar to our penny.


'Quid' is slang for 1 pound sterling (roughly $2), and a penny is roughly 2 cents.

Everybody says quid, and it's easier on a computer in case the reader's browser doesn't support the Libre 'pound' symbol. For instance, in the british civil service, I believe it is common practice to use a small i instead of the pound symbol.

You learn something every day!


Cool! I was watching the office on BBC America last night and they were talking about Quid. The manager paid the secretary 100 quid to help him in a motivational speaking event.

The easiest way to save data into a text file on server side - Help me please

Embarrassed

Hi guys, I'm new at ASP and all I wanna know is, what is the simplest code for gathering info from my website visitors (using the FORM object) and saving it to a text file (*.TXT) on the web server? The whole procedure. I know it's lame, but is there anyone out there, that could help me with this one? Thanks guys.

Andrew

You could do something like the following. Here txtName and txtAddress are textboxes. Similarly you can add all the controls that you want to save.

The collected data is saved in the current directory on the webserver in a file called Test.txt. All subsequent saves will be appended to the same file (change the last parameter
to false to overwrite on every save)

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim s As String
s += txtName.Text + vbCrLf
s += txtAddress.Text + vbCrLf
My.Computer.FileSystem.WriteAllText(Server.MapPath("Test.txt"), s, True)

end sub

Tuesday, March 13, 2012

the language shown in Chinese?

Hallo guys! Nice to join this forum!!

I have a question regarding ASP.NET web control. I created "Calendar" and I wrote simple code on it. Surprisingly after I run and display in IE, all the characters were in Chinese. I doubled check the control panel and set the regional and language to be all in English but all in vain. What should I do?

My second question is only for my own curiosity: After I did some changes to the language, I restart the PC and surprisingly the code window seemed to be zoom in a bit, it is now displayed in slightly larger fonts and a bit irritating.
Do you know how I could retrieve back the original font size in code window?

Thanks =)Internet Explorer > Tools > Options > Language button.

What language do you have there?
Hi, hehehe... I checked already, it was shown English (United Kingdom)...

But still cannot display correct English Calendar! Thanks!

The LINQ "where" clause

Hi guys,

I'm trying to write a LINQ query in which the where clause can accept 6 parameters. The problem is that all of them are optional parameters and need to be validated as not Null or Empty in order to be used. Normally when I used the SqlCommand I would build a string for the query via conditional statements, like:

if (!String.IsNullOrEmpty(TextBox1.Text)) { SqlString +="..." }

How do I do the equivalent to that in LINQ?

Thanks in advance!

not sure if i understand what you mean. do you mean validate a statement as a parameter? In that case you can write like this with the ? syntax:

object o;

o = (cond1 = cond2 ? truevalue : falsevalue);

MyFunction( String.IsNullOrEmpty(TextBox1.Text) ? truevalue : falsevalue)


Well, this is how I did it the non-LINQ way:

string SqlString =string.Empty;if (!String.IsNullOrEmpty(TextBox1.Text)) { SqlString +="...";}if (!String.IsNullOrEmpty(TextBox2.Text)) { SqlString +="...";}SqlCommand MyCommand =new SqlCommand(SqlString, MyConnection);

In the code above I created the SqlString variable. After that I would check if the Text property is Null or Empty for the TextBox1 & TextBox2 andonly append to the SqlString if they are not. Then I run the newly built Sql query. I need to do the equivalent in LINQ and I just don't know how.