|
Hi,
I have developped a site by selecting the File System as location option in VS.Net 2008.
After completing it I have published it, then I tried to host it and access it from IIS.
I am getting Web.Config error.
Can anybody give me advice or any link to host a site on IIS which is developped in File System location in VS. 2008 or 2005.
Thanks a Lot,
Abdul Aleem
Thanks & Regards,
Md. Abdul Aleem
NIIT technologies
|
|
|
|
|
Good Afternoon Abdul
You are doing this the Wrong way. after you compiled and think that your application is workking as it should. you must first create a Virtual Directory with IIS and add your Project Files there and Configure your start page and and bla bla bla. This will be a problem for you because you dont know what setting to touch in the IIS, i sugest you create a setup Project and deploy it like you are deploying an exe, another thing we cant say much if you dont show the error that you saw in the Web.Config
Thanks
Vuyiswa Maseko
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.tiyaneProperties.co.za
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
indian143 wrote: I am getting Web.Config error.
Which Error Are You getting?
indian143 wrote: Can anybody give me advice or any link to host a site on IIS which is developped in File System location in VS. 2008 or 2005.
Deploying Websites on IIS does not depends on the Visual Studio in which you have developed.
Which IIS Version are you using ?
If IIS 7.0 Check Here Deploying Web Sites in IIS 7.0
|
|
|
|
|
code written in register button click event
protected void Button1_Click(object sender, System.EventArgs E)
{
//Response.Redirect("confirm.aspx");
if((txtid.Text=="") || (txtfname.Text=="") ||( txtlname.Text=="") || (txtnick.Text=="") ||
(txtadd.Text=="") || (txtpost.Text=="") ||
(txtmobile.Text=="") || (txtbdate.Text=="") || (txtemailadd.Text=="")
|| (txtconfirmpss.Text=="") || (txtyourans.Text==""))
Labelerror.Text =" sorry you for got to input the required fields";
else
{
SqlConnection conn = new SqlConnection(Application["ConnectionString"].ToString());
String insertCmd = "insert into users values (@StudentID," +
"@password, @FirstName, @LastName,@secretquestion, @NickName,@Sex ,@Address, @PostalCode," +
" @HomePhone,@MobilePhone,@Religion,@Birthdate,@MaritalStatus,@Title,"+
"@EmailAddress,@answer )";
// Initialize the SqlCommand with the new SQL string
// and the connection information.
SqlCommand myCommand = new SqlCommand(insertCmd, conn);
conn.Open();
// Create new parameters for the SqlCommand object and
// initialize them to the input-form field values.
myCommand.Parameters.Add(new SqlParameter("@StudentID", SqlDbType.NVarChar , 10));
myCommand.Parameters["@StudentID"].Value = txtid.Text;
myCommand.Parameters.Add(new SqlParameter("@password", SqlDbType.NVarChar , 15));
myCommand.Parameters["@password"].Value = txtconfirmpss.Text ;
myCommand.Parameters.Add(new SqlParameter("@FirstName", SqlDbType.NVarChar , 30));
myCommand.Parameters["@FirstName"].Value = txtfname.Text;
myCommand.Parameters.Add(new SqlParameter("@LastName", SqlDbType.NVarChar , 50));
myCommand.Parameters["@LastName"].Value = txtlname.Text;
myCommand.Parameters.Add(new SqlParameter("@secretquestion", SqlDbType.NVarChar , 50));
myCommand.Parameters["@secretquestion"].Value = Drops.SelectedItem.Text;
myCommand.Parameters.Add(new SqlParameter("@NickName", SqlDbType.NVarChar , 20));
myCommand.Parameters["@NickName"].Value = txtnick.Text;
myCommand.Parameters.Add(new SqlParameter("@Sex", SqlDbType.NVarChar , 20));
myCommand.Parameters["@Sex"].Value = Dropsex.SelectedItem.Text;
myCommand.Parameters.Add(new SqlParameter("@Address", SqlDbType.NVarChar , 255));
myCommand.Parameters["@Address"].Value = txtadd.Text;
myCommand.Parameters.Add(new SqlParameter("@PostalCode", SqlDbType.NVarChar , 20));
myCommand.Parameters["@PostalCode"].Value = txtpost.Text ;
myCommand.Parameters.Add(new SqlParameter("@HomePhone", SqlDbType.NVarChar , 40));
myCommand.Parameters["@HomePhone"].Value = txthphone.Text;
//mobile phone
myCommand.Parameters.Add(new SqlParameter("@MobilePhone", SqlDbType.NVarChar , 20));
myCommand.Parameters["@MobilePhone"].Value = txtmobile.Text;
myCommand.Parameters.Add(new SqlParameter("@Religion", SqlDbType.NVarChar , 20));
myCommand.Parameters["@Religion"].Value = Dropr.SelectedItem.Text;
myCommand.Parameters.Add(new SqlParameter("@Birthdate", SqlDbType.NVarChar , 20));
myCommand.Parameters["@Birthdate"].Value = txtbdate.Text ;
myCommand.Parameters.Add(new SqlParameter("@MaritalStatus", SqlDbType.NVarChar , 20));
myCommand.Parameters["@MaritalStatus"].Value =Dropmerit.SelectedItem.Text;
myCommand.Parameters.Add(new SqlParameter("@Title", SqlDbType.NVarChar , 50));
myCommand.Parameters["@Title"].Value =txttitle.Text;
myCommand.Parameters.Add(new SqlParameter("@EmailAddress", SqlDbType.NVarChar , 50));
myCommand.Parameters["@EmailAddress"].Value = txtemailadd.Text ;
myCommand.Parameters.Add(new SqlParameter("@answer", SqlDbType.NVarChar , 50));
myCommand.Parameters["@answer"].Value = txtyourans.Text ;
// conn.Close();
//conn.Open();
//myCommand.Connection.Open();
//myCommand.Connection.Open();
//conn.Open();
try
{
myCommand.ExecuteNonQuery();
//conn.ExecuteNonQuery();
Response.Redirect("confirm.aspx");
//Labelerror.Text=" new data has been added";
//Message.InnerHtml = "<b>Record Added</b><br>" + insertCmd;
}
catch (SqlException e)
{
if (e.Number == 2627)
Labelerror.Text = "ERROR: A record already exists with the same student ID";
else
Labelerror.Text = "ERROR: Could not add record, please ensure the fields are correctly filled out";
//Labelerror.Text = Convert.ToString(txtadd.Text);
}
finally
{
//myCommand.Connection.Close();
conn.Close();
}
//BindGrid();
}
}
the above code i have written for registration form for some project
but it is showing an error as follows
An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)
i used the connection string in web.config as
<add name="ConnectionString" connectionString="server=.;Integrated security=true;Database=AustaExam"
providerName="System.Data.SqlClient" />
|
|
|
|
|
First of all your post is looks like Crap.
sritha wrote: An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)
Did you tried to google it ?
This is one of the most common error for connecting with SQL server . Which SQL Server Version are you using?
|
|
|
|
|
Hi Clever people
I have a simple question and for the life of me, just cant seem to track down the problem. When I am running my web application from the desktop in VS 2008, it reads the png image and displays it for me. The moment I copy and configure the web application in IIS still running it from VS, then the image does not pull through at all.
Can anyone please tell me what I am doing wrong. BTW, it is not the image path since both starts with ../Images/test.png
The only difference in the URL is that from IIS it's http://localhost/ while from the desktop it is http://localhost:1234/
Sorry if I am being an Idiot!
Elizma
|
|
|
|
|
Hi Elizma,
I have the same problem with IIS 7 on Vista. After I modified my PNG files IIS did not refresh them, so I could see only the old version of them.
As a workaround I switched to VS 2008's Development Server (Project properties / Web / Servers / Use Visual Studio Development Server) as you did.
My only problem with this, that sometimes the Dev. Server handles the cookies incorrectly, I so need to switch back and forth between IIS and VS Dev. Server
Interestingly I had no problems on our production server.
I hope we'll get a proper fix soon...
Andras
|
|
|
|
|
Hi people, this is very very urgent. please help.
I have a user control which is being loaded dynamically. This user control is being placed ina place holder. The code is as follows:
UserControl ucUserControl = (UserControl)Page.LoadControl("../AM/UserControls/ucMyUserControl.ascx");
ucUserControl.ID = "userControl_ID";
phPlaceHolder.Controls.Add(ucUserControl);
Now,
I am trying to access the user control by using FindControl:
UserControl ucUserControl = (UserControl)phPlaceHolder.FindControl("userControl_ID");
The problem is the user control is not detected. That is,
ucUserControl = null
Please help guys. Thanks.
|
|
|
|
|
Use the following in your aspx page...
<%@ Reference Control="../AM/UserControls/ucMyUserControl.ascx" %>
"Don't worry if it doesn't work right. If everything did, you'd be out of a job." (Mosher's Law of Software Engineering)
|
|
|
|
|
Hi,
I think I got this ASP.NET Server Control code from this site. It works in Firefox but not in IE (DotNetNuke). Does anyone know why? Or does anyone have a bespoke Map Control for Virtual Earth (just the code) which I can look at? I've tried Windows Live Tools and get querky errors....so thought I could adapt the code below to suit my needs
ASP.net 2.0
Language - VB
Site Content Manager – Dot Net Nuke
VB Code:
Imports System
Imports System.Web
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports System.ComponentModel
Imports System.Collections
Public Class MapControl
Inherits WebControl
#Region "Variables"
Private _dataSource As IEnumerable
Private _VarMap As String = "var map = null;"
Private _GetMapOpen As String = "function GetMap(){"
Private _CloseBracket As String = "}"
Private _LoadMap As String = "map.LoadMap();"
Private _PinId1 As String = "var pinid1=0;"
Private _Locs1Array As String = "var locs1 = new Array;"
Private _MapAddPushpin As String = "map.AddPushpin(pin);"
Private _IncrementPinId As String = "pinid1++;"
Private _Latitude As String = "47.6"
Private _Longitude As String = "-122.33"
Private _ZoomLevel As Integer = 10
#End Region
#Region "Properties"
Public Property DataSource() As IEnumerable
Get
Return _dataSource
End Get
Set(ByVal value As IEnumerable)
_dataSource = value
End Set
End Property
<Browsable(True), Category("Position")> _
Public Property Latitude() As String
Get
Return _Latitude
End Get
Set(ByVal value As String)
_Latitude = value
End Set
End Property
<Browsable(True), Category("Position")> _
Public Property Longitude() As String
Get
Return _Longitude
End Get
Set(ByVal value As String)
_Longitude = value
End Set
End Property
<Browsable(True), Category("Position")> _
Public Property ZoomLevel() As Integer
Get
Return _ZoomLevel
End Get
Set(ByVal value As Integer)
_ZoomLevel = value
End Set
End Property
#End Region
#Region "String Functions"
Private Function NewNamedMap(ByVal MapName As String) As String
Return "map = new VEMap('" & MapName & "');"
End Function
Private Function NewLocation(ByVal longatude As String, ByVal latitude As String) As String
Return "var loc = new VELatLong(" & longatude & "," & latitude & ");"
End Function
Private Function AddPushPin(ByVal Arr As String, ByVal Location As String) As String
Return Arr & ".push(" & Location & ");"
End Function
Private Function ForOpen(ByVal Arr As String) As String
Return "for (i=0; i < " & Arr & ".length; i++){"
End Function
Private Function RunBestMap(ByVal Arr As String) As String
Return "DoBestMap(" & Arr & ");"
End Function
#End Region
#Region "Map Strings"
Private Function MapWithDatasource() As String
Dim str As String = ""
str &= "<script "
str &= "type=""text/javascript"""
str &= ">"
str &= _GetMapOpen & _VarMap & NewNamedMap("MyNewMap") & _LoadMap
str &= _Locs1Array
str &= _PinId1
Dim DataEnum As IEnumerator
DataEnum = DataSource.GetEnumerator()
Dim i As Integer = 0
'str &= ForOpen("locs1")
While (DataEnum.MoveNext())
Dim st1, st2, st3, st4 As String
st1 = DataEnum.Current
DataEnum.MoveNext()
st2 = DataEnum.Current
DataEnum.MoveNext()
st3 = DataEnum.Current
DataEnum.MoveNext()
st4 = DataEnum.Current
str &= NewLocation(st1, st2)
str &= AddPushPin("locs1", "loc")
str &= "var pin = new VEPushpin(" & i.ToString & ", locs1[" & i.ToString & "], null, '" & st3 & "', '" & st4 & "');"
str &= "map.AddPushpin(pin);"
i += 1
End While
'str &= _CloseBracket
str &= "map.SetMapView(locs1);"
str &= _CloseBracket
str &= "</script>"
Return str
End Function
Private Function BasicMap() As String
Dim str As String = ""
str = "<script ""language=""JavaScript"">"
If Latitude <> "" And Longitude <> "" Then
str &= _GetMapOpen & _VarMap & NewNamedMap("MyNewMap") & _
"map.LoadMap(new VELatLong(" & Latitude.ToString & "," & Longitude.ToString & "), " & ZoomLevel.ToString & ",'h' ,false);" & _CloseBracket
Else
str &= _GetMapOpen & _VarMap & NewNamedMap("MyNewMap") & _LoadMap & _CloseBracket
End If
str &= "</script>"
Return str
End Function
#End Region
#Region "Control Methods"
Protected Overrides Sub OnPreRender(ByVal e As System.EventArgs)
MyBase.OnPreRender(e)
Dim meta As String = "<meta http-equiv=""Content-Type"" content=""text/html; charset=utf-8"">"
Dim link As String = "<script type=""text/javascript"" src=""http://dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=6.2""></script>"
Me.Page.ClientScript.RegisterClientScriptBlock(GetType(String), "Meta", meta)
Me.Page.ClientScript.RegisterClientScriptBlock(GetType(String), "Link", link)
Controls.Add(New LiteralControl("<div id='MyNewMap' style=""position:relative; width:600px; height:300px;""></div>"))
If Not _dataSource Is Nothing Then
Me.Page.ClientScript.RegisterClientScriptBlock(GetType(String), "OnLoad", MapWithDatasource)
Else
Me.Page.ClientScript.RegisterClientScriptBlock(GetType(String), "OnLoad", BasicMap)
End If
End Sub
Protected Overrides Sub OnDataBinding(ByVal e As EventArgs)
Controls.Clear()
End Sub
#End Region
End Class
|
|
|
|
|
Hi!
I have a project which I am currently working on and I am looking for some ideas on how you would create the solution.
I have multiple folders which all contain word documents and pdfs. The folders are organised by sections, almost like chapters in a book. I have one main folder, Technical, and within these folders I have "chapters" which also have "sub chapters" and some even have "sub, sub chapters".
Basically I have no control over how deep the chapters go.
Just now I have the main folder, within that folder I have chapters 1, 2, 3, 4 etc.
In folder 1 I then have more folders, 1.1, 1.2, 1.3, etc. within Folder 1.2 I have 1.2.1, 1.2.2, 1.2.3 etc, you get the idea.
What I would like to is create a visual representation of this so its easy to navigate via a website.
Ideally I would have something like this:
Technical.aspx (Main Section)
Chapter 1
Bit of a description of this chapter
Chapter 2
Bit of a decription of this chapter
Chapter 3
Bit of a description of this chapter.
etc....
Then someone clicks on Chapter 1 they get the same as above but with only Chapter 1's subchapters.
I am thinking about using a database so the descriptions can be stored in it.
Any thoughts on how to manage this would be great. Im still very new to C# ASP.net so any help you can give is much appriciated.
|
|
|
|
|
I think I have got a step further. I will create a single table in my database with the following columns.
ID, parentID, fileDescription
The ParentID will refer to the ID, but how could I create a webpage that dynamically displays only the relevant info.
i.e. The root page will only show items which don't have a parentID, the next webpage would only show the links that are relevant to it depending on which ID its just come from.
|
|
|
|
|
Hi friends,
I am in a strange problem. I have a swf object that shows the 3D view of a house. Now I need to embed the swf to a PDF so that it would work and play the 3d animation within the PDF itself. I know it could be done using Adobe Apollo, but it doesnt support to do this programmatically.
I want the user can download the pdf report with the flash object embeded within it.
Do you know how to do this? Any sdk that could work with .NET tech. iText is a library that does it, as they claims so, but it is in JAVA.
Regards
Abhishek
|
|
|
|
|
Hello,
I need to generate a few charts based on data stored in my database on SQL Server. I had no idea of how to generate charts with standard values itself.A little search on the Internet gave me the following code which works well:
Dim Image As New Bitmap(500, 300, PixelFormat.Format32bppRgb)
Dim g As Graphics = Graphics.FromImage(Image)
Dim redPen As New Pen(Color.Red, 10)
Dim blueBrush As New SolidBrush(Color.Blue)
Dim myImage As Bitmap
Dim p() As Integer = {1000000, 600000, 2500000, 80000}
Dim towns() As String = {"A", "B", "C", "D"}
Dim myBrushes(4) As Brush
myImage = New Bitmap(500, 300, PixelFormat.Format32bppRgb)
g = Graphics.FromImage(myImage)
' Create the brushes for drawing
myBrushes(0) = New SolidBrush(Color.Red)
myBrushes(1) = New SolidBrush(Color.Blue)
myBrushes(2) = New SolidBrush(Color.Yellow)
myBrushes(3) = New SolidBrush(Color.Green)
' Variables declaration
Dim i As Integer
Dim xInterval As Integer = 100
Dim width As Integer = 90
Dim height As Integer
Dim blackBrush As New SolidBrush(Color.Black)
For i = 0 To p.Length - 1
height = (p(i) \ 10000) ' divide by 10000 to adjust barchart to height of Bitmap
' Draws the bar chart using specific colours
g.FillRectangle(myBrushes(i), xInterval * i + 50, 280 - height, width, height)
' label the barcharts
g.DrawString(towns(i), New Font("Verdana", 12, FontStyle.Bold), Brushes.Black, xInterval * i + 50 + (width / 3), 280 - height - 25)
' Draw the scale
g.DrawString(height, New Font("Verdana", 8, FontStyle.Bold), Brushes.Black, 0, 280 - height)
' Draw the axes
g.DrawLine(Pens.Brown, 40, 10, 40, 290) ' y-axis
g.DrawLine(Pens.Brown, 20, 280, 490, 280) ' x-axis
Next
myImage.Save(Response.OutputStream, _
System.Drawing.Imaging.ImageFormat.Jpeg)
But now i need to know how in the p() array I can input values from the database dynamically i.e the number of values in the database could vary with time.The code should automatically input all the values in the table in the databse and generate the appropriate chart.How do i do this?
|
|
|
|
|
In programming practice, we mostly use classes in entity layer where only properties are there and no calculations at all.
In that scenario we can use structures also which will consume less momery and will be faster also.
For exmaple:
User.UserName, User.Password, etc.
What are the pros and cons if "User" is struct or Class.
Thanks.
|
|
|
|
|
|
Dear All,
I have created a web application which includes crystal report for reports. Now the problem is that my reports were not working on the webserver.
The Application works Perfectly on my local machine in IIS and in .net environment but if i upload the same application on the web server it shows the error.
An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.
Details: To enable the details of this specific error message to be viewable on remote machines, please create a <customErrors> tag within a "web.config" configuration file located in the root directory of the current web application. This <customErrors> tag should then have its "mode" attribute set to "Off".
What could be the solution
Thanks and Regards
Yogesh Agarwal
|
|
|
|
|
i feel it is not an error related to crystal report.
as we know custom error handlers are using for customise the default error pages.
custom error[^]
It may be some other error in you program
Do you have crystal report runtime installed on you web server?
|
|
|
|
|
Hi Thanks for the reply
I just want to check the report running on server or not. So i create a C.R. with no databinding, their is only a label in my C.R. that displays. This is my C.R.. So their is no programming involves there.
And about the runtime environment on server i have no idea.
Thanks
|
|
|
|
|
hi yogesh
for hosting are you using shared hosting server or dedicated server?
if it is dedicated server you can install crystal report runtime on your server.
|
|
|
|
|
Hi All..
I am just trying with Timer control in my web project. I have to check database at every minute and change the updates in my page.
How can I do?
Thanks in Advance
|
|
|
|
|
In the OnTick event of the Timer Control add your logic to check the database and do the necessary changes.
"Don't worry if it doesn't work right. If everything did, you'd be out of a job." (Mosher's Law of Software Engineering)
|
|
|
|
|
Ya...
My code is like..
<asp:timer id="NotificationTimer" runat="server" interval="15000" ontick="NotificationTimer_Tick">
protected void NotificationTimer_Tick(object sender, EventArgs e)
{
//My code to get data from db
}
Its working fine...But every 1 minute the page should refreshed so , remaining in the UpdatePanel like grid also loaded once again...
whats the problem?????? How to avoid this?
|
|
|
|
|
In my application i have to use a timer.Actually a print option which will be enabled after 5 min.after a print is done it will be disabled for 5 min,i.e no print will be done for next 5 min.After that one can print it.
How can it be achieved.
|
|
|
|
|
use SetInterval to increment a value after a certain interval.. and check if 5 min is elapsed.
After that make print enabled..
|
|
|
|
|