Thursday, March 29, 2012
Newbie - Need to prevent duplicate entries..
Need your help on this issue that I have with asp.net application. I
would really appreciate your help.
I am using Formview to save data into the database, Fields are
(date_from, date_to, time_from, Time_To - All are datetime format and a
roomNumber taken from a value in dropdownlist)
My requirement is simple; I want to prevent other user making
reservation on the specific room with the same dates and times and
within those range.
How will I use sqldatasource insert or any other ways of inserting to
prevent duplicate..
I am sorry for the confusion, i am new to asp.net
Here is the code i am using: --
<%@dotnet.itags.org. Page Language="VB" AutoEventWireup="false"
CodeFile="insert2.aspx.vb" Inherits="adminaccess_insert2" %>
<%@dotnet.itags.org. Register Assembly="eWorld.UI, Version=2.0.3.2310, Culture=neutral,
PublicKeyToken=24d65337282035f2"
Namespace="eWorld.UI" TagPrefix="ew" %>
<%@dotnet.itags.org. Import Namespace="System.Net.Mail" %>
<!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>
<form id="form1" runat="server">
<div />
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$
ConnectionStrings:RoomReservationConnect
ionString3 %>"
InsertCommand="INSERT INTO [ReservationInfo]
([Date_From], [Date_To], [Time_From], [Time_To], [RoomNo])
VALUES
(@dotnet.itags.org.Date_From, @dotnet.itags.org.Date_To, @dotnet.itags.org.Time_From, @dotnet.itags.org.Time_To, @dotnet.itags.org.RoomNo)" >
<InsertParameters>
<asp:Parameter Name="Date_From" Type="DateTime" />
<asp:Parameter Name="Date_To" Type="DateTime" />
<asp:Parameter Name="Time_From" Type="DateTime" />
<asp:Parameter Name="Time_To" Type="DateTime" />
<asp:Parameter Name="RoomNo" Type="String" />
</InsertParameters>
</asp:SqlDataSource>
<asp:FormView ID="FormView1" runat="server" DataKeyNames="Id"
DataSourceID="SqlDataSource1" DefaultMode="Insert">
<InsertItemTemplate>
Date_From:
<br />
<ew:CalendarPopup ID="Date_From" runat="server"
PostedDate=""
SelectedDate='<%# Bind("Date_From") %>'
ImageUrl="~/images/calendar4.jpg"
ControlDisplay="TextBoxImage"
UpperBoundDate="12/31/9999 23:59:59"
Culture="(Default)" Text="Select Date
From">
<ButtonStyle Font-Names="verdana"
Font-Size="8pt"
BackColor="#DEE37F" />
</ew:CalendarPopup>
<br />
<br />
Date_To:
<br />
<ew:CalendarPopup ID="Date_To" runat="server"
PostedDate="" SelectedDate='<%# Bind("Date_To") %>'
ImageUrl="~/images/calendar4.jpg"
ControlDisplay="TextBoxImage" UpperBoundDate="12/31/9999 23:59:59"
Culture="(Default)" Text="Select Date To">
<ButtonStyle Font-Names="verdana"
Font-Size="8pt" BackColor="#DEE37F" />
</ew:CalendarPopup>
<br />
<br />
Time From:
<br />
<ew:TimePicker ID="Time_From" runat="server"
ImageUrl="~/images/calendar3.jpg" NumberOfColumns="3"
LowerBoundTime="12/30/1899 07:00:00"
UpperBoundTime="12/30/1899 23:00:00"
ControlDisplay="TextBoxImage"
PopupLocation="Bottom" PopupWidth="170px"
PopupHeight="178px" EnableViewState="true"
SelectedValue='<%# Bind("Time_From", "{t}")
%>'
PostedTime="7:00 PM"
SelectedTime="12/30/1899 19:00:00"
Text="Select Time Start">
<SelectedTimeStyle BackColor="Khaki"
ForeColor="Black" />
<TimeStyle BackColor="SteelBlue"
ForeColor="White" />
<ButtonStyle BackColor="#DEE37F"
Font-Names="verdana" Font-Size="8pt" />
</ew:TimePicker>
<br />
<br />
Time To:
<br />
<ew:TimePicker ID="Time_To" runat="server"
ImageUrl="~/images/calendar3.jpg"
ControlDisplay="TextBoxImage"
NumberOfColumns="3" LowerBoundTime="11/25/3506 07:00:00"
UpperBoundTime="11/25/3506 23:00:00"
PopupLocation="Bottom" PopupWidth="170px"
PopupHeight="178px" SelectedValue='<%#
Bind("Time_To", "{0:t}") %>' PostedTime="7:00 PM"
SelectedTime="11/25/3506 19:00:28"
Text="Select Time Ends">
<SelectedTimeStyle BackColor="Khaki"
ForeColor="Black" />
<TimeStyle BackColor="SteelBlue"
ForeColor="White" />
<ButtonStyle BackColor="#DEE37F"
Font-Names="verdana" Font-Size="8pt" />
</ew:TimePicker>
<br />
<br />
RoomNo:
<asp:DropDownList ID="RoomNo" runat="server"
DataSourceID="SqlDataSource3" DataTextField="RoomNo"
AppendDataBoundItems="true"
DataValueField="RoomNo" SelectedValue='<%# Bind("RoomNo") %>'>
<asp:ListItem Selected="True">Pls. Select
Your Room No.</asp:ListItem>
</asp:DropDownList><br />
<br />
<%-- Start of DataSource --%>
<asp:SqlDataSource ID="SqlDataSource3" runat="server"
ConnectionString="<%$
ConnectionStrings:RoomReservationConnect
ionString %>"
SelectCommand="SELECT * FROM
[RoomInfo]"></asp:SqlDataSource>
<asp:LinkButton ID="InsertButton" runat="server"
CausesValidation="True" CommandName="Insert"
Text="Insert">
</asp:LinkButton>
<asp:LinkButton ID="InsertCancelButton" runat="server"
CausesValidation="False" CommandName="Cancel"
Text="Cancel">
</asp:LinkButton>
</InsertItemTemplate>
</asp:FormView>
<br />
<asp:Label ID="Label1" runat="server" Text="Label"
Height="18px" Visible="False"></asp:Label>
</form>
</body>
</html>This is really something you want to do in two places. Firstly, design
your UI such that it only offers the option of reserving a room which
is not yet taken. Have you considered using a calendar control of some
kind?
That would probably be more intuitive for use, and has the advantage
that you can only allow certain ranges to be selected.
Secondly, your database should be responsible for maintaining the
integrity of your data. The business rule "A room can be exclusively
reserved for a set of N days, and the time spans may not overlap" can
be handled as a constraint of some kind.
If you try to violate that constraint, your database will throw an
error, and you can handle the resulting exception in your code.
YMPN wrote:
> Dear All,
> Need your help on this issue that I have with asp.net application. I
> would really appreciate your help.
> I am using Formview to save data into the database, Fields are
> (date_from, date_to, time_from, Time_To - All are datetime format and a
> roomNumber taken from a value in dropdownlist)
> My requirement is simple; I want to prevent other user making
> reservation on the specific room with the same dates and times and
> within those range.
> How will I use sqldatasource insert or any other ways of inserting to
> prevent duplicate..
> I am sorry for the confusion, i am new to asp.net
>
> Here is the code i am using: --
> <%@. Page Language="VB" AutoEventWireup="false"
> CodeFile="insert2.aspx.vb" Inherits="adminaccess_insert2" %>
> <%@. Register Assembly="eWorld.UI, Version=2.0.3.2310, Culture=neutral,
> PublicKeyToken=24d65337282035f2"
> Namespace="eWorld.UI" TagPrefix="ew" %>
> <%@. Import Namespace="System.Net.Mail" %>
> <!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>
> <form id="form1" runat="server">
> <div />
> <asp:SqlDataSource ID="SqlDataSource1" runat="server"
> ConnectionString="<%$
> ConnectionStrings:RoomReservationConnect
ionString3 %>"
> InsertCommand="INSERT INTO [ReservationInfo]
> ([Date_From], [Date_To], [Time_From], [Time_To], [RoomNo])
> VALUES
> (@.Date_From, @.Date_To, @.Time_From, @.Time_To, @.RoomNo)" >
>
> <InsertParameters>
> <asp:Parameter Name="Date_From" Type="DateTime" />
> <asp:Parameter Name="Date_To" Type="DateTime" />
> <asp:Parameter Name="Time_From" Type="DateTime" />
> <asp:Parameter Name="Time_To" Type="DateTime" />
> <asp:Parameter Name="RoomNo" Type="String" />
> </InsertParameters>
> </asp:SqlDataSource>
>
>
> <asp:FormView ID="FormView1" runat="server" DataKeyNames="Id"
> DataSourceID="SqlDataSource1" DefaultMode="Insert">
> <InsertItemTemplate>
> Date_From:
> <br />
>
> <ew:CalendarPopup ID="Date_From" runat="server"
> PostedDate=""
> SelectedDate='<%# Bind("Date_From") %>'
> ImageUrl="~/images/calendar4.jpg"
> ControlDisplay="TextBoxImage"
> UpperBoundDate="12/31/9999 23:59:59"
> Culture="(Default)" Text="Select Date
> From">
> <ButtonStyle Font-Names="verdana"
> Font-Size="8pt"
> BackColor="#DEE37F" />
> </ew:CalendarPopup>
> <br />
> <br />
> Date_To:
> <br />
>
> <ew:CalendarPopup ID="Date_To" runat="server"
> PostedDate="" SelectedDate='<%# Bind("Date_To") %>'
> ImageUrl="~/images/calendar4.jpg"
> ControlDisplay="TextBoxImage" UpperBoundDate="12/31/9999 23:59:59"
> Culture="(Default)" Text="Select Date To">
> <ButtonStyle Font-Names="verdana"
> Font-Size="8pt" BackColor="#DEE37F" />
> </ew:CalendarPopup>
> <br />
> <br />
> Time From:
> <br />
> <ew:TimePicker ID="Time_From" runat="server"
> ImageUrl="~/images/calendar3.jpg" NumberOfColumns="3"
> LowerBoundTime="12/30/1899 07:00:00"
> UpperBoundTime="12/30/1899 23:00:00"
> ControlDisplay="TextBoxImage"
> PopupLocation="Bottom" PopupWidth="170px"
> PopupHeight="178px" EnableViewState="true"
> SelectedValue='<%# Bind("Time_From", "{t}")
> %>'
> PostedTime="7:00 PM"
> SelectedTime="12/30/1899 19:00:00"
> Text="Select Time Start">
> <SelectedTimeStyle BackColor="Khaki"
> ForeColor="Black" />
> <TimeStyle BackColor="SteelBlue"
> ForeColor="White" />
> <ButtonStyle BackColor="#DEE37F"
> Font-Names="verdana" Font-Size="8pt" />
> </ew:TimePicker>
> <br />
> <br />
> Time To:
> <br />
>
> <ew:TimePicker ID="Time_To" runat="server"
> ImageUrl="~/images/calendar3.jpg"
> ControlDisplay="TextBoxImage"
> NumberOfColumns="3" LowerBoundTime="11/25/3506 07:00:00"
> UpperBoundTime="11/25/3506 23:00:00"
> PopupLocation="Bottom" PopupWidth="170px"
> PopupHeight="178px" SelectedValue='<%#
> Bind("Time_To", "{0:t}") %>' PostedTime="7:00 PM"
> SelectedTime="11/25/3506 19:00:28"
> Text="Select Time Ends">
> <SelectedTimeStyle BackColor="Khaki"
> ForeColor="Black" />
> <TimeStyle BackColor="SteelBlue"
> ForeColor="White" />
> <ButtonStyle BackColor="#DEE37F"
> Font-Names="verdana" Font-Size="8pt" />
> </ew:TimePicker>
> <br />
> <br />
> RoomNo:
> <asp:DropDownList ID="RoomNo" runat="server"
> DataSourceID="SqlDataSource3" DataTextField="RoomNo"
> AppendDataBoundItems="true"
> DataValueField="RoomNo" SelectedValue='<%# Bind("RoomNo") %>'>
> <asp:ListItem Selected="True">Pls. Select
> Your Room No.</asp:ListItem>
> </asp:DropDownList><br />
> <br />
> <%-- Start of DataSource --%>
>
> <asp:SqlDataSource ID="SqlDataSource3" runat="server"
> ConnectionString="<%$
> ConnectionStrings:RoomReservationConnect
ionString %>"
> SelectCommand="SELECT * FROM
> [RoomInfo]"></asp:SqlDataSource>
> <asp:LinkButton ID="InsertButton" runat="server"
> CausesValidation="True" CommandName="Insert"
> Text="Insert">
> </asp:LinkButton>
> <asp:LinkButton ID="InsertCancelButton" runat="server"
> CausesValidation="False" CommandName="Cancel"
> Text="Cancel">
> </asp:LinkButton>
>
> </InsertItemTemplate>
> </asp:FormView>
> <br />
> <asp:Label ID="Label1" runat="server" Text="Label"
> Height="18px" Visible="False"></asp:Label>
> </form>
> </body>
> </html>
You're already using a calendar control. Apologies for imbecility. It's
only 5:30 pm and I'm generally not at my best until at least 9:00 :)
Flinky Wisty Pomm wrote:
> This is really something you want to do in two places. Firstly, design
> your UI such that it only offers the option of reserving a room which
> is not yet taken. Have you considered using a calendar control of some
> kind?
> That would probably be more intuitive for use, and has the advantage
> that you can only allow certain ranges to be selected.
> Secondly, your database should be responsible for maintaining the
> integrity of your data. The business rule "A room can be exclusively
> reserved for a set of N days, and the time spans may not overlap" can
> be handled as a constraint of some kind.
> If you try to violate that constraint, your database will throw an
> error, and you can handle the resulting exception in your code.
>
> YMPN wrote:
>
I really appreciate your response FWP. I need all the help that I can..
What you said...
"The business rule "A room can be exclusively
reserved for a set of N days, and the time spans may not overlap" can
be handled as a constraint of some kind.
If you try to violate that constraint, your database will throw an
error, and you can handle the resulting exception in your code.
-- end of qoute --
Can anybody please "translate" this into a working code that I may use
or assist me.
Thanks people...
Flinky Wisty Pomm wrote:
> You're already using a calendar control. Apologies for imbecility. It's
> only 5:30 pm and I'm generally not at my best until at least 9:00 :)
>
> Flinky Wisty Pomm wrote:
>
Newbie - Need to prevent duplicate entries..
Need your help on this issue that I have with asp.net application. I
would really appreciate your help.
I am using Formview to save data into the database, Fields are
(date_from, date_to, time_from, Time_To - All are datetime format and a
roomNumber taken from a value in dropdownlist)
My requirement is simple; I want to prevent other user making
reservation on the specific room with the same dates and times and
within those range.
How will I use sqldatasource insert or any other ways of inserting to
prevent duplicate..
I am sorry for the confusion, i am new to asp.net
Here is the code i am using: ---
<%@dotnet.itags.org. Page Language="VB" AutoEventWireup="false"
CodeFile="insert2.aspx.vb" Inherits="adminaccess_insert2" %>
<%@dotnet.itags.org. Register Assembly="eWorld.UI, Version=2.0.3.2310, Culture=neutral,
PublicKeyToken=24d65337282035f2"
Namespace="eWorld.UI" TagPrefix="ew" %>
<%@dotnet.itags.org. Import Namespace="System.Net.Mail" %>
<!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>
<form id="form1" runat="server">
<div />
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$
ConnectionStrings:RoomReservationConnectionString3 %>"
InsertCommand="INSERT INTO [ReservationInfo]
([Date_From], [Date_To], [Time_From], [Time_To], [RoomNo])
VALUES
(@dotnet.itags.org.Date_From, @dotnet.itags.org.Date_To, @dotnet.itags.org.Time_From, @dotnet.itags.org.Time_To, @dotnet.itags.org.RoomNo)" >
<InsertParameters>
<asp:Parameter Name="Date_From" Type="DateTime" />
<asp:Parameter Name="Date_To" Type="DateTime" />
<asp:Parameter Name="Time_From" Type="DateTime" />
<asp:Parameter Name="Time_To" Type="DateTime" />
<asp:Parameter Name="RoomNo" Type="String" />
</InsertParameters>
</asp:SqlDataSource>
<asp:FormView ID="FormView1" runat="server" DataKeyNames="Id"
DataSourceID="SqlDataSource1" DefaultMode="Insert">
<InsertItemTemplate>
Date_From:
<br />
<ew:CalendarPopup ID="Date_From" runat="server"
PostedDate=""
SelectedDate='<%# Bind("Date_From") %>'
ImageUrl="~/images/calendar4.jpg"
ControlDisplay="TextBoxImage"
UpperBoundDate="12/31/9999 23:59:59"
Culture="(Default)" Text="Select Date
From">
<ButtonStyle Font-Names="verdana"
Font-Size="8pt"
BackColor="#DEE37F" />
</ew:CalendarPopup>
<br />
<br />
Date_To:
<br />
<ew:CalendarPopup ID="Date_To" runat="server"
PostedDate="" SelectedDate='<%# Bind("Date_To") %>'
ImageUrl="~/images/calendar4.jpg"
ControlDisplay="TextBoxImage" UpperBoundDate="12/31/9999 23:59:59"
Culture="(Default)" Text="Select Date To">
<ButtonStyle Font-Names="verdana"
Font-Size="8pt" BackColor="#DEE37F" />
</ew:CalendarPopup>
<br />
<br />
Time From:
<br />
<ew:TimePicker ID="Time_From" runat="server"
ImageUrl="~/images/calendar3.jpg" NumberOfColumns="3"
LowerBoundTime="12/30/1899 07:00:00"
UpperBoundTime="12/30/1899 23:00:00"
ControlDisplay="TextBoxImage"
PopupLocation="Bottom" PopupWidth="170px"
PopupHeight="178px" EnableViewState="true"
SelectedValue='<%# Bind("Time_From", "{t}")
%>'
PostedTime="7:00 PM"
SelectedTime="12/30/1899 19:00:00"
Text="Select Time Start">
<SelectedTimeStyle BackColor="Khaki"
ForeColor="Black" />
<TimeStyle BackColor="SteelBlue"
ForeColor="White" />
<ButtonStyle BackColor="#DEE37F"
Font-Names="verdana" Font-Size="8pt" />
</ew:TimePicker>
<br />
<br />
Time To:
<br />
<ew:TimePicker ID="Time_To" runat="server"
ImageUrl="~/images/calendar3.jpg"
ControlDisplay="TextBoxImage"
NumberOfColumns="3" LowerBoundTime="11/25/3506 07:00:00"
UpperBoundTime="11/25/3506 23:00:00"
PopupLocation="Bottom" PopupWidth="170px"
PopupHeight="178px" SelectedValue='<%#
Bind("Time_To", "{0:t}") %>' PostedTime="7:00 PM"
SelectedTime="11/25/3506 19:00:28"
Text="Select Time Ends">
<SelectedTimeStyle BackColor="Khaki"
ForeColor="Black" />
<TimeStyle BackColor="SteelBlue"
ForeColor="White" />
<ButtonStyle BackColor="#DEE37F"
Font-Names="verdana" Font-Size="8pt" />
</ew:TimePicker>
<br />
<br />
RoomNo:
<asp:DropDownList ID="RoomNo" runat="server"
DataSourceID="SqlDataSource3" DataTextField="RoomNo"
AppendDataBoundItems="true"
DataValueField="RoomNo" SelectedValue='<%# Bind("RoomNo") %>'>
<asp:ListItem Selected="True">Pls. Select
Your Room No.</asp:ListItem>
</asp:DropDownList><br />
<br />
<%-- Start of DataSource --%>
<asp:SqlDataSource ID="SqlDataSource3" runat="server"
ConnectionString="<%$
ConnectionStrings:RoomReservationConnectionString %>"
SelectCommand="SELECT * FROM
[RoomInfo]"></asp:SqlDataSource>
<asp:LinkButton ID="InsertButton" runat="server"
CausesValidation="True" CommandName="Insert"
Text="Insert">
</asp:LinkButton>
<asp:LinkButton ID="InsertCancelButton" runat="server"
CausesValidation="False" CommandName="Cancel"
Text="Cancel">
</asp:LinkButton>
</InsertItemTemplate>
</asp:FormView>
<br />
<asp:Label ID="Label1" runat="server" Text="Label"
Height="18px" Visible="False"></asp:Label>
</form>
</body>
</html>This is really something you want to do in two places. Firstly, design
your UI such that it only offers the option of reserving a room which
is not yet taken. Have you considered using a calendar control of some
kind?
That would probably be more intuitive for use, and has the advantage
that you can only allow certain ranges to be selected.
Secondly, your database should be responsible for maintaining the
integrity of your data. The business rule "A room can be exclusively
reserved for a set of N days, and the time spans may not overlap" can
be handled as a constraint of some kind.
If you try to violate that constraint, your database will throw an
error, and you can handle the resulting exception in your code.
YMPN wrote:
Quote:
Originally Posted by
Dear All,
>
Need your help on this issue that I have with asp.net application. I
would really appreciate your help.
>
I am using Formview to save data into the database, Fields are
(date_from, date_to, time_from, Time_To - All are datetime format and a
roomNumber taken from a value in dropdownlist)
>
My requirement is simple; I want to prevent other user making
reservation on the specific room with the same dates and times and
within those range.
>
How will I use sqldatasource insert or any other ways of inserting to
prevent duplicate..
>
I am sorry for the confusion, i am new to asp.net
>
>
Here is the code i am using: ---
>
<%@. Page Language="VB" AutoEventWireup="false"
CodeFile="insert2.aspx.vb" Inherits="adminaccess_insert2" %>
>
<%@. Register Assembly="eWorld.UI, Version=2.0.3.2310, Culture=neutral,
PublicKeyToken=24d65337282035f2"
Namespace="eWorld.UI" TagPrefix="ew" %>
<%@. Import Namespace="System.Net.Mail" %>
<!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>
<form id="form1" runat="server">
<div />
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$
ConnectionStrings:RoomReservationConnectionString3 %>"
InsertCommand="INSERT INTO [ReservationInfo]
([Date_From], [Date_To], [Time_From], [Time_To], [RoomNo])
VALUES
(@.Date_From, @.Date_To, @.Time_From, @.Time_To, @.RoomNo)" >
>
>
>
<InsertParameters>
<asp:Parameter Name="Date_From" Type="DateTime" />
<asp:Parameter Name="Date_To" Type="DateTime" />
<asp:Parameter Name="Time_From" Type="DateTime" />
<asp:Parameter Name="Time_To" Type="DateTime" />
<asp:Parameter Name="RoomNo" Type="String" />
</InsertParameters>
</asp:SqlDataSource>
>
>
>
>
<asp:FormView ID="FormView1" runat="server" DataKeyNames="Id"
DataSourceID="SqlDataSource1" DefaultMode="Insert">
>
<InsertItemTemplate>
Date_From:
<br />
>
>
<ew:CalendarPopup ID="Date_From" runat="server"
>
PostedDate=""
SelectedDate='<%# Bind("Date_From") %>'
ImageUrl="~/images/calendar4.jpg"
ControlDisplay="TextBoxImage"
UpperBoundDate="12/31/9999 23:59:59"
Culture="(Default)" Text="Select Date
From">
<ButtonStyle Font-Names="verdana"
Font-Size="8pt"
BackColor="#DEE37F" />
</ew:CalendarPopup>
<br />
<br />
Date_To:
<br />
>
>
<ew:CalendarPopup ID="Date_To" runat="server"
PostedDate="" SelectedDate='<%# Bind("Date_To") %>'
ImageUrl="~/images/calendar4.jpg"
ControlDisplay="TextBoxImage" UpperBoundDate="12/31/9999 23:59:59"
Culture="(Default)" Text="Select Date To">
<ButtonStyle Font-Names="verdana"
Font-Size="8pt" BackColor="#DEE37F" />
</ew:CalendarPopup>
<br />
<br />
Time From:
<br />
>
<ew:TimePicker ID="Time_From" runat="server"
ImageUrl="~/images/calendar3.jpg" NumberOfColumns="3"
LowerBoundTime="12/30/1899 07:00:00"
UpperBoundTime="12/30/1899 23:00:00"
ControlDisplay="TextBoxImage"
PopupLocation="Bottom" PopupWidth="170px"
PopupHeight="178px" EnableViewState="true"
>
SelectedValue='<%# Bind("Time_From", "{t}")
%>'
PostedTime="7:00 PM"
SelectedTime="12/30/1899 19:00:00"
>
Text="Select Time Start">
<SelectedTimeStyle BackColor="Khaki"
ForeColor="Black" />
<TimeStyle BackColor="SteelBlue"
ForeColor="White" />
<ButtonStyle BackColor="#DEE37F"
Font-Names="verdana" Font-Size="8pt" />
</ew:TimePicker>
<br />
<br />
Time To:
<br />
>
>
<ew:TimePicker ID="Time_To" runat="server"
ImageUrl="~/images/calendar3.jpg"
ControlDisplay="TextBoxImage"
NumberOfColumns="3" LowerBoundTime="11/25/3506 07:00:00"
UpperBoundTime="11/25/3506 23:00:00"
PopupLocation="Bottom" PopupWidth="170px"
PopupHeight="178px" SelectedValue='<%#
Bind("Time_To", "{0:t}") %>' PostedTime="7:00 PM"
SelectedTime="11/25/3506 19:00:28"
Text="Select Time Ends">
<SelectedTimeStyle BackColor="Khaki"
ForeColor="Black" />
<TimeStyle BackColor="SteelBlue"
ForeColor="White" />
<ButtonStyle BackColor="#DEE37F"
Font-Names="verdana" Font-Size="8pt" />
</ew:TimePicker>
<br />
<br />
RoomNo:
<asp:DropDownList ID="RoomNo" runat="server"
DataSourceID="SqlDataSource3" DataTextField="RoomNo"
AppendDataBoundItems="true"
DataValueField="RoomNo" SelectedValue='<%# Bind("RoomNo") %>'>
<asp:ListItem Selected="True">Pls. Select
Your Room No.</asp:ListItem>
</asp:DropDownList><br />
<br />
>
<%-- Start of DataSource --%>
>
>
<asp:SqlDataSource ID="SqlDataSource3" runat="server"
ConnectionString="<%$
ConnectionStrings:RoomReservationConnectionString %>"
>
SelectCommand="SELECT * FROM
[RoomInfo]"></asp:SqlDataSource>
>
<asp:LinkButton ID="InsertButton" runat="server"
CausesValidation="True" CommandName="Insert"
Text="Insert">
</asp:LinkButton>
<asp:LinkButton ID="InsertCancelButton" runat="server"
CausesValidation="False" CommandName="Cancel"
Text="Cancel">
</asp:LinkButton>
>
>
</InsertItemTemplate>
</asp:FormView>
<br />
<asp:Label ID="Label1" runat="server" Text="Label"
Height="18px" Visible="False"></asp:Label>
>
</form>
</body>
</html>
You're already using a calendar control. Apologies for imbecility. It's
only 5:30 pm and I'm generally not at my best until at least 9:00 :)
Flinky Wisty Pomm wrote:
Quote:
Originally Posted by
This is really something you want to do in two places. Firstly, design
your UI such that it only offers the option of reserving a room which
is not yet taken. Have you considered using a calendar control of some
kind?
>
That would probably be more intuitive for use, and has the advantage
that you can only allow certain ranges to be selected.
>
Secondly, your database should be responsible for maintaining the
integrity of your data. The business rule "A room can be exclusively
reserved for a set of N days, and the time spans may not overlap" can
be handled as a constraint of some kind.
>
If you try to violate that constraint, your database will throw an
error, and you can handle the resulting exception in your code.
>
>
YMPN wrote:
>
Quote:
Originally Posted by
Dear All,
Need your help on this issue that I have with asp.net application. I
would really appreciate your help.
I am using Formview to save data into the database, Fields are
(date_from, date_to, time_from, Time_To - All are datetime format and a
roomNumber taken from a value in dropdownlist)
My requirement is simple; I want to prevent other user making
reservation on the specific room with the same dates and times and
within those range.
How will I use sqldatasource insert or any other ways of inserting to
prevent duplicate..
I am sorry for the confusion, i am new to asp.net
Here is the code i am using: ---
<%@. Page Language="VB" AutoEventWireup="false"
CodeFile="insert2.aspx.vb" Inherits="adminaccess_insert2" %>
<%@. Register Assembly="eWorld.UI, Version=2.0.3.2310, Culture=neutral,
PublicKeyToken=24d65337282035f2"
Namespace="eWorld.UI" TagPrefix="ew" %>
<%@. Import Namespace="System.Net.Mail" %>
<!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>
<form id="form1" runat="server">
<div />
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$
ConnectionStrings:RoomReservationConnectionString3 %>"
InsertCommand="INSERT INTO [ReservationInfo]
([Date_From], [Date_To], [Time_From], [Time_To], [RoomNo])
VALUES
(@.Date_From, @.Date_To, @.Time_From, @.Time_To, @.RoomNo)" >
<InsertParameters>
<asp:Parameter Name="Date_From" Type="DateTime" />
<asp:Parameter Name="Date_To" Type="DateTime" />
<asp:Parameter Name="Time_From" Type="DateTime" />
<asp:Parameter Name="Time_To" Type="DateTime" />
<asp:Parameter Name="RoomNo" Type="String" />
</InsertParameters>
</asp:SqlDataSource>
<asp:FormView ID="FormView1" runat="server" DataKeyNames="Id"
DataSourceID="SqlDataSource1" DefaultMode="Insert">
<InsertItemTemplate>
Date_From:
<br />
<ew:CalendarPopup ID="Date_From" runat="server"
PostedDate=""
SelectedDate='<%# Bind("Date_From") %>'
ImageUrl="~/images/calendar4.jpg"
ControlDisplay="TextBoxImage"
UpperBoundDate="12/31/9999 23:59:59"
Culture="(Default)" Text="Select Date
From">
<ButtonStyle Font-Names="verdana"
Font-Size="8pt"
BackColor="#DEE37F" />
</ew:CalendarPopup>
<br />
<br />
Date_To:
<br />
<ew:CalendarPopup ID="Date_To" runat="server"
PostedDate="" SelectedDate='<%# Bind("Date_To") %>'
ImageUrl="~/images/calendar4.jpg"
ControlDisplay="TextBoxImage" UpperBoundDate="12/31/9999 23:59:59"
Culture="(Default)" Text="Select Date To">
<ButtonStyle Font-Names="verdana"
Font-Size="8pt" BackColor="#DEE37F" />
</ew:CalendarPopup>
<br />
<br />
Time From:
<br />
<ew:TimePicker ID="Time_From" runat="server"
ImageUrl="~/images/calendar3.jpg" NumberOfColumns="3"
LowerBoundTime="12/30/1899 07:00:00"
UpperBoundTime="12/30/1899 23:00:00"
ControlDisplay="TextBoxImage"
PopupLocation="Bottom" PopupWidth="170px"
PopupHeight="178px" EnableViewState="true"
SelectedValue='<%# Bind("Time_From", "{t}")
%>'
PostedTime="7:00 PM"
SelectedTime="12/30/1899 19:00:00"
Text="Select Time Start">
<SelectedTimeStyle BackColor="Khaki"
ForeColor="Black" />
<TimeStyle BackColor="SteelBlue"
ForeColor="White" />
<ButtonStyle BackColor="#DEE37F"
Font-Names="verdana" Font-Size="8pt" />
</ew:TimePicker>
<br />
<br />
Time To:
<br />
<ew:TimePicker ID="Time_To" runat="server"
ImageUrl="~/images/calendar3.jpg"
ControlDisplay="TextBoxImage"
NumberOfColumns="3" LowerBoundTime="11/25/3506 07:00:00"
UpperBoundTime="11/25/3506 23:00:00"
PopupLocation="Bottom" PopupWidth="170px"
PopupHeight="178px" SelectedValue='<%#
Bind("Time_To", "{0:t}") %>' PostedTime="7:00 PM"
SelectedTime="11/25/3506 19:00:28"
Text="Select Time Ends">
<SelectedTimeStyle BackColor="Khaki"
ForeColor="Black" />
<TimeStyle BackColor="SteelBlue"
ForeColor="White" />
<ButtonStyle BackColor="#DEE37F"
Font-Names="verdana" Font-Size="8pt" />
</ew:TimePicker>
<br />
<br />
RoomNo:
<asp:DropDownList ID="RoomNo" runat="server"
DataSourceID="SqlDataSource3" DataTextField="RoomNo"
AppendDataBoundItems="true"
DataValueField="RoomNo" SelectedValue='<%# Bind("RoomNo") %>'>
<asp:ListItem Selected="True">Pls. Select
Your Room No.</asp:ListItem>
</asp:DropDownList><br />
<br />
<%-- Start of DataSource --%>
<asp:SqlDataSource ID="SqlDataSource3" runat="server"
ConnectionString="<%$
ConnectionStrings:RoomReservationConnectionString %>"
SelectCommand="SELECT * FROM
[RoomInfo]"></asp:SqlDataSource>
<asp:LinkButton ID="InsertButton" runat="server"
CausesValidation="True" CommandName="Insert"
Text="Insert">
</asp:LinkButton>
<asp:LinkButton ID="InsertCancelButton" runat="server"
CausesValidation="False" CommandName="Cancel"
Text="Cancel">
</asp:LinkButton>
</InsertItemTemplate>
</asp:FormView>
<br />
<asp:Label ID="Label1" runat="server" Text="Label"
Height="18px" Visible="False"></asp:Label>
</form>
</body>
</html>
I really appreciate your response FWP. I need all the help that I can..
What you said...
"The business rule "A room can be exclusively
reserved for a set of N days, and the time spans may not overlap" can
be handled as a constraint of some kind.
If you try to violate that constraint, your database will throw an
error, and you can handle the resulting exception in your code.
-- end of qoute --
Can anybody please "translate" this into a working code that I may use
or assist me.
Thanks people...
Flinky Wisty Pomm wrote:
Quote:
Originally Posted by
You're already using a calendar control. Apologies for imbecility. It's
only 5:30 pm and I'm generally not at my best until at least 9:00 :)
>
>
Flinky Wisty Pomm wrote:
>
Quote:
Originally Posted by
This is really something you want to do in two places. Firstly, design
your UI such that it only offers the option of reserving a room which
is not yet taken. Have you considered using a calendar control of some
kind?
That would probably be more intuitive for use, and has the advantage
that you can only allow certain ranges to be selected.
Secondly, your database should be responsible for maintaining the
integrity of your data. The business rule "A room can be exclusively
reserved for a set of N days, and the time spans may not overlap" can
be handled as a constraint of some kind.
If you try to violate that constraint, your database will throw an
error, and you can handle the resulting exception in your code.
YMPN wrote:
Quote:
Originally Posted by
Dear All,
>
Need your help on this issue that I have with asp.net application. I
would really appreciate your help.
>
I am using Formview to save data into the database, Fields are
(date_from, date_to, time_from, Time_To - All are datetime format and a
roomNumber taken from a value in dropdownlist)
>
My requirement is simple; I want to prevent other user making
reservation on the specific room with the same dates and times and
within those range.
>
How will I use sqldatasource insert or any other ways of inserting to
prevent duplicate..
>
I am sorry for the confusion, i am new to asp.net
>
>
Here is the code i am using: ---
>
<%@. Page Language="VB" AutoEventWireup="false"
CodeFile="insert2.aspx.vb" Inherits="adminaccess_insert2" %>
>
<%@. Register Assembly="eWorld.UI, Version=2.0.3.2310, Culture=neutral,
PublicKeyToken=24d65337282035f2"
Namespace="eWorld.UI" TagPrefix="ew" %>
<%@. Import Namespace="System.Net.Mail" %>
<!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>
<form id="form1" runat="server">
<div />
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$
ConnectionStrings:RoomReservationConnectionString3 %>"
InsertCommand="INSERT INTO [ReservationInfo]
([Date_From], [Date_To], [Time_From], [Time_To], [RoomNo])
VALUES
(@.Date_From, @.Date_To, @.Time_From, @.Time_To, @.RoomNo)" >
>
>
>
<InsertParameters>
<asp:Parameter Name="Date_From" Type="DateTime" />
<asp:Parameter Name="Date_To" Type="DateTime" />
<asp:Parameter Name="Time_From" Type="DateTime" />
<asp:Parameter Name="Time_To" Type="DateTime" />
<asp:Parameter Name="RoomNo" Type="String" />
</InsertParameters>
</asp:SqlDataSource>
>
>
>
>
<asp:FormView ID="FormView1" runat="server" DataKeyNames="Id"
DataSourceID="SqlDataSource1" DefaultMode="Insert">
>
<InsertItemTemplate>
Date_From:
<br />
>
>
<ew:CalendarPopup ID="Date_From" runat="server"
>
PostedDate=""
SelectedDate='<%# Bind("Date_From") %>'
ImageUrl="~/images/calendar4.jpg"
ControlDisplay="TextBoxImage"
UpperBoundDate="12/31/9999 23:59:59"
Culture="(Default)" Text="Select Date
From">
<ButtonStyle Font-Names="verdana"
Font-Size="8pt"
BackColor="#DEE37F" />
</ew:CalendarPopup>
<br />
<br />
Date_To:
<br />
>
>
<ew:CalendarPopup ID="Date_To" runat="server"
PostedDate="" SelectedDate='<%# Bind("Date_To") %>'
ImageUrl="~/images/calendar4.jpg"
ControlDisplay="TextBoxImage" UpperBoundDate="12/31/9999 23:59:59"
Culture="(Default)" Text="Select Date To">
<ButtonStyle Font-Names="verdana"
Font-Size="8pt" BackColor="#DEE37F" />
</ew:CalendarPopup>
<br />
<br />
Time From:
<br />
>
<ew:TimePicker ID="Time_From" runat="server"
ImageUrl="~/images/calendar3.jpg" NumberOfColumns="3"
LowerBoundTime="12/30/1899 07:00:00"
UpperBoundTime="12/30/1899 23:00:00"
ControlDisplay="TextBoxImage"
PopupLocation="Bottom" PopupWidth="170px"
PopupHeight="178px" EnableViewState="true"
>
SelectedValue='<%# Bind("Time_From", "{t}")
%>'
PostedTime="7:00 PM"
SelectedTime="12/30/1899 19:00:00"
>
Text="Select Time Start">
<SelectedTimeStyle BackColor="Khaki"
ForeColor="Black" />
<TimeStyle BackColor="SteelBlue"
ForeColor="White" />
<ButtonStyle BackColor="#DEE37F"
Font-Names="verdana" Font-Size="8pt" />
</ew:TimePicker>
<br />
<br />
Time To:
<br />
>
>
<ew:TimePicker ID="Time_To" runat="server"
ImageUrl="~/images/calendar3.jpg"
ControlDisplay="TextBoxImage"
NumberOfColumns="3" LowerBoundTime="11/25/3506 07:00:00"
UpperBoundTime="11/25/3506 23:00:00"
PopupLocation="Bottom" PopupWidth="170px"
PopupHeight="178px" SelectedValue='<%#
Bind("Time_To", "{0:t}") %>' PostedTime="7:00 PM"
SelectedTime="11/25/3506 19:00:28"
Text="Select Time Ends">
<SelectedTimeStyle BackColor="Khaki"
ForeColor="Black" />
<TimeStyle BackColor="SteelBlue"
ForeColor="White" />
<ButtonStyle BackColor="#DEE37F"
Font-Names="verdana" Font-Size="8pt" />
</ew:TimePicker>
<br />
<br />
RoomNo:
<asp:DropDownList ID="RoomNo" runat="server"
DataSourceID="SqlDataSource3" DataTextField="RoomNo"
AppendDataBoundItems="true"
DataValueField="RoomNo" SelectedValue='<%# Bind("RoomNo") %>'>
<asp:ListItem Selected="True">Pls. Select
Your Room No.</asp:ListItem>
</asp:DropDownList><br />
<br />
>
<%-- Start of DataSource --%>
>
>
<asp:SqlDataSource ID="SqlDataSource3" runat="server"
ConnectionString="<%$
ConnectionStrings:RoomReservationConnectionString %>"
>
SelectCommand="SELECT * FROM
[RoomInfo]"></asp:SqlDataSource>
>
<asp:LinkButton ID="InsertButton" runat="server"
CausesValidation="True" CommandName="Insert"
Text="Insert">
</asp:LinkButton>
<asp:LinkButton ID="InsertCancelButton" runat="server"
CausesValidation="False" CommandName="Cancel"
Text="Cancel">
</asp:LinkButton>
>
>
</InsertItemTemplate>
</asp:FormView>
<br />
<asp:Label ID="Label1" runat="server" Text="Label"
Height="18px" Visible="False"></asp:Label>
>
</form>
</body>
</html>
Newbie - Protecting source code
ripped off when I load it onto a 3rd party web server? (Someone copying the
.cs files, and removing them)
Is there a way to compile these .cs files for the ASP.NET pages to read.If you're using VS.NET, compile the project,
and only upload the dll's and .aspx files to your
server or, if you're not using VS.NET, compile
the assemblies ( dlls ) from the command line
and deploy them, with your .aspx files, to the server.
Juan T. Llibre
ASP.NET MVP
===========
"Fronky" <nospam@.nospam.com> wrote in message
news:OJmXokTCFHA.2032@.tk2msftngp13.phx.gbl...
> If I create an ASP.NET (c#) web application, how can I prevent my code
> being
> ripped off when I load it onto a 3rd party web server? (Someone copying
> the
> .cs files, and removing them)
> Is there a way to compile these .cs files for the ASP.NET pages to read.
>
Sorted it! Thanks for your help!
"Juan T. Llibre" <nomailreplies@.nowhere.com> wrote in message
news:uxQbcyTCFHA.1396@.TK2MSFTNGP14.phx.gbl...
> If you're using VS.NET, compile the project,
> and only upload the dll's and .aspx files to your
> server or, if you're not using VS.NET, compile
> the assemblies ( dlls ) from the command line
> and deploy them, with your .aspx files, to the server.
>
>
> Juan T. Llibre
> ASP.NET MVP
> ===========
> "Fronky" <nospam@.nospam.com> wrote in message
> news:OJmXokTCFHA.2032@.tk2msftngp13.phx.gbl...
>
Of course, if the security on the server is such that someone could view the
source code of your ASP.Net pages, you have a more serious problem.
HTH,
Kevin Spencer
Microsoft MVP
.Net Developer
Neither a follower nor a lender be.
"Fronky" <nospam@.nospam.com> wrote in message
news:u5HmNDUCFHA.520@.TK2MSFTNGP09.phx.gbl...
> Sorted it! Thanks for your help!
>
> "Juan T. Llibre" <nomailreplies@.nowhere.com> wrote in message
> news:uxQbcyTCFHA.1396@.TK2MSFTNGP14.phx.gbl...
>
"Kevin Spencer" <kevin@.DIESPAMMERSDIEtakempis.com> wrote in message
news:O$DN%23pVCFHA.3976@.tk2msftngp13.phx.gbl...
> Of course, if the security on the server is such that someone could view
> the source code of your ASP.Net pages, you have a more serious problem.
LOL! Absolutely!
Newbie - Protecting source code
ripped off when I load it onto a 3rd party web server? (Someone copying the
..cs files, and removing them)
Is there a way to compile these .cs files for the ASP.NET pages to read.If you're using VS.NET, compile the project,
and only upload the dll's and .aspx files to your
server or, if you're not using VS.NET, compile
the assemblies ( dlls ) from the command line
and deploy them, with your .aspx files, to the server.
Juan T. Llibre
ASP.NET MVP
===========
"Fronky" <nospam@.nospam.com> wrote in message
news:OJmXokTCFHA.2032@.tk2msftngp13.phx.gbl...
> If I create an ASP.NET (c#) web application, how can I prevent my code
> being
> ripped off when I load it onto a 3rd party web server? (Someone copying
> the
> .cs files, and removing them)
> Is there a way to compile these .cs files for the ASP.NET pages to read.
Sorted it! Thanks for your help!
"Juan T. Llibre" <nomailreplies@.nowhere.com> wrote in message
news:uxQbcyTCFHA.1396@.TK2MSFTNGP14.phx.gbl...
> If you're using VS.NET, compile the project,
> and only upload the dll's and .aspx files to your
> server or, if you're not using VS.NET, compile
> the assemblies ( dlls ) from the command line
> and deploy them, with your .aspx files, to the server.
>
>
> Juan T. Llibre
> ASP.NET MVP
> ===========
> "Fronky" <nospam@.nospam.com> wrote in message
> news:OJmXokTCFHA.2032@.tk2msftngp13.phx.gbl...
> > If I create an ASP.NET (c#) web application, how can I prevent my code
> > being
> > ripped off when I load it onto a 3rd party web server? (Someone copying
> > the
> > .cs files, and removing them)
> > Is there a way to compile these .cs files for the ASP.NET pages to read.
Of course, if the security on the server is such that someone could view the
source code of your ASP.Net pages, you have a more serious problem.
--
HTH,
Kevin Spencer
Microsoft MVP
..Net Developer
Neither a follower nor a lender be.
"Fronky" <nospam@.nospam.com> wrote in message
news:u5HmNDUCFHA.520@.TK2MSFTNGP09.phx.gbl...
> Sorted it! Thanks for your help!
>
> "Juan T. Llibre" <nomailreplies@.nowhere.com> wrote in message
> news:uxQbcyTCFHA.1396@.TK2MSFTNGP14.phx.gbl...
>> If you're using VS.NET, compile the project,
>> and only upload the dll's and .aspx files to your
>> server or, if you're not using VS.NET, compile
>> the assemblies ( dlls ) from the command line
>> and deploy them, with your .aspx files, to the server.
>>
>>
>>
>>
>> Juan T. Llibre
>> ASP.NET MVP
>> ===========
>> "Fronky" <nospam@.nospam.com> wrote in message
>> news:OJmXokTCFHA.2032@.tk2msftngp13.phx.gbl...
>> > If I create an ASP.NET (c#) web application, how can I prevent my code
>> > being
>> > ripped off when I load it onto a 3rd party web server? (Someone copying
>> > the
>> > .cs files, and removing them)
>> > Is there a way to compile these .cs files for the ASP.NET pages to
>> > read.
>>>>
>>
"Kevin Spencer" <kevin@.DIESPAMMERSDIEtakempis.com> wrote in message
news:O$DN%23pVCFHA.3976@.tk2msftngp13.phx.gbl...
> Of course, if the security on the server is such that someone could view
> the source code of your ASP.Net pages, you have a more serious problem.
LOL! Absolutely!
Monday, March 26, 2012
Newbie : Setting Application Wide Data
config settings), and why? eg. suppose I wanted to define an array of valid
image file types (*.bmp, *.gif, *.jpg), is it best to store this as an
application array in the global.asax, or set of XML nodes in the appSettings
of the web.config file, or neither.
tia
AshYou could store this information in web.config, but you'd probably have to
write a custom handler to parse the data. I find the easiest way is to have
a class which exposes global application-wide data through static methods or
properties (so you don't have to instantiate the class to get the data).
Mun
"Ash" <aschel.kritsos@.[DELETEME]ecb.co.uk> wrote in message
news:uQsajKHqDHA.1444@.tk2msftngp13.phx.gbl...
> Where is the best place to define application wide data (not necessarily
> config settings), and why? eg. suppose I wanted to define an array of
valid
> image file types (*.bmp, *.gif, *.jpg), is it best to store this as an
> application array in the global.asax, or set of XML nodes in the
appSettings
> of the web.config file, or neither.
> tia
> Ash
Newbie :) Where do I start?
So after years of wanting to try to write a software application, I decided to give it a go. My question is, which application or language should I start with? After looking around a bit, I thought Visual Studio 2005 Basic Express might be the ticket? I have no idea.
I want to make a very specific scheduling application for my business, that can be used on a windows machine (NT, 2000, XP) and also a MAC (OSX) system. I also would like people to be able to access some of the schedule on an HTML page. The one thing that I would like to implement is a nice user interface. I am not opposed to using any program, just want to make sure I start out on the right foot. Someone suggested REALbasic would be the way to go http://www.realsoftware.com/
Any help for a first timer with a lot of patience would be appreciated.
Thanks in advance :)
Kilgorwell, it DOES depend what you want to do.
If you need to do something web-based, why not try WebMatrix?
My suggestion would be to get yourself a book or two for starters. As you are all new to the game, you may just as well choose C# as your preferred language, but if you want to learn you should not try to cut corners that does a lot of work for you. To become any good you need to know the basics and there is no easy way. You need to read and get practice by doing.
Now for the books, there are many. And I will leave it up to someone else to recommend these to avoid getting entangled in a debate about which one is best :)
Well, I'll mention 2 books just for the h*ll of it:
- Asp.Net Unleashed, Stephen Walther, SAMS (Although VB.Net I found it very well written)
- Microsoft Visual C# .Net Step by Step, John Sharp/Jon Jagger, Microsoft Press
Thanks guys,
I have a couple questions
1) I am not sure what C# is compared to C++ or even .net
2) My goal is to write and app for Windows as well as MAC.
3) One concern I have with asp.net is that everything I see written in that looks like a web page. I am looking to design an interface that is a little more "aqua" like than a flat tab web
page.
Any more ideas or directions for dummys (not really) would be helpful.
Thanks
Kilgor
so you're saying you want to write an actual desktop application? maybe ASP.NET is not for you then.
if you want to write for Mac and Windows (I hate to say this) your best bet might be Java - though I suspect Mono will allow you to deploy .NET code on the Mac using GTK+ (?) instead of Windows.Forms.
However if you're this tentative and green, you might be being far too ambitious in trying to jump in this deep right out of the blocks. start out smaller.
> One concern I have with asp.net is that everything I see written in that looks like a web page.
The reason for that is because that's what ASP.NET does, basically. Web pages. Not desktop apps.
newbie and the /bin dir
For a new ASP.Net application, I've read that it's dll's need to be stored
in the /bin dir which is created under the wwwroot/ directory.
I've also read that you can store dll's in a /bin dir under the application
itself e.g. wwwroot/myapp/bin.
I'm just trying to get to grips with the above...
- is the root /bin dir for dll's that are accessed by different web
applications?
- is the application /bin dir for dll's that are only accessed by the
application itself?
We have a few ASP apps on an ISP and are looking to xfer these to .Net. Is
is better to put our app dll's in the app /bin directory or risk class
compatibility problems by putting them in root/bin? Are there any security
problems or loss of performance putting them in an app dll?
Thanks for any advice given.
Best regards
Bob"Bob H" <bh15@.le.ac.uk> wrote in message
news:btbf8c$bin$1@.south.jnrs.ja.net...
> Hi,
> For a new ASP.Net application, I've read that it's dll's need to be stored
> in the /bin dir which is created under the wwwroot/ directory.
> I've also read that you can store dll's in a /bin dir under the
application
> itself e.g. wwwroot/myapp/bin.
> I'm just trying to get to grips with the above...
> - is the root /bin dir for dll's that are accessed by different web
> applications?
> - is the application /bin dir for dll's that are only accessed by the
> application itself?
> We have a few ASP apps on an ISP and are looking to xfer these to .Net. Is
> is better to put our app dll's in the app /bin directory or risk class
> compatibility problems by putting them in root/bin? Are there any security
> problems or loss of performance putting them in an app dll?
> Thanks for any advice given.
> Best regards
> Bob
When you use Visual Studio to build your ASP.Net application, that will
compile
your application into dll's and place them in your application-bin
directory.
Using Visual Studio, you need to "reference" your COM-dll's. Those com-dll's
need to be registered as usual. A .Net interface is automatically generated.
Hans Kesting
Hi bob,
to understand this, you need to understand a bit about IIS web applications,
and how they are configured, in particular, ASP.Net applications.
In IIS, a web application is configured in the metabase. A web application
is a distinct memory space which is used by all server-side entities
belonging to a web application. A web application is defined by a set of
folders and files that reside under the "root" folder of the application. If
a sub-folder of an application root folder is configured as a web
application, it has its own separate memory space for all folders underneath
it. Therefore, you can have nested web applications, one inside another
physically (in the folder structure) but having a completely separate memory
space.
In ASP.Net, there are certain special files and folders which relate to the
web application. One of these is the bin folder. The bin folder must reside
directly underneath the application root folder. This is how ASP.Net apps
find the DLLs that you store there. You can tweak the location of these DLLs
in the configuration files if you need to, but usually you don't, and you
should store your DLLs in the bin folder directly under the root. In
addition, the web.config and global.asax files for each application must
reside in the root folder of that application.
--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
"Bob H" <bh15@.le.ac.uk> wrote in message
news:btbf8c$bin$1@.south.jnrs.ja.net...
> Hi,
> For a new ASP.Net application, I've read that it's dll's need to be stored
> in the /bin dir which is created under the wwwroot/ directory.
> I've also read that you can store dll's in a /bin dir under the
application
> itself e.g. wwwroot/myapp/bin.
> I'm just trying to get to grips with the above...
> - is the root /bin dir for dll's that are accessed by different web
> applications?
> - is the application /bin dir for dll's that are only accessed by the
> application itself?
> We have a few ASP apps on an ISP and are looking to xfer these to .Net. Is
> is better to put our app dll's in the app /bin directory or risk class
> compatibility problems by putting them in root/bin? Are there any security
> problems or loss of performance putting them in an app dll?
> Thanks for any advice given.
> Best regards
> Bob
Hi,
I'm also a newbie in ASP.NET. I'm wondering if the bin dir for the dll
is neccessary or if there is a possibility to store the dll of the web
application at an other place. E.g. in the application root.
Can anyone please tell me whether this is possible and if not why not.
Perhaps someone of you also know a link to the specification of
ASP.NET where that things a described.
Thanks In Advance
Markus Heid
"Kevin Spencer" <kevin@.takempis.com> wrote in message news:<eV27qn60DHA.4032@.tk2msftngp13.phx.gbl>...
> Hi bob,
> to understand this, you need to understand a bit about IIS web applications,
> and how they are configured, in particular, ASP.Net applications.
> In IIS, a web application is configured in the metabase. A web application
> is a distinct memory space which is used by all server-side entities
> belonging to a web application. A web application is defined by a set of
> folders and files that reside under the "root" folder of the application. If
> a sub-folder of an application root folder is configured as a web
> application, it has its own separate memory space for all folders underneath
> it. Therefore, you can have nested web applications, one inside another
> physically (in the folder structure) but having a completely separate memory
> space.
> In ASP.Net, there are certain special files and folders which relate to the
> web application. One of these is the bin folder. The bin folder must reside
> directly underneath the application root folder. This is how ASP.Net apps
> find the DLLs that you store there. You can tweak the location of these DLLs
> in the configuration files if you need to, but usually you don't, and you
> should store your DLLs in the bin folder directly under the root. In
> addition, the web.config and global.asax files for each application must
> reside in the root folder of that application.
> --
> HTH,
> Kevin Spencer
> .Net Developer
> Microsoft MVP
> Big things are made up
> of lots of little things.
newbie asp.net user control question
an .ascx extension. I use this control many times within this
application and it works fine. I wrote this user control to be
generic though, because I want it to be accessible from other asp.net
applications as well. How do I break out the user control into a
seperate dll that can be references by many asp.net apps? I fooled
around with the "Web Control Library" but I must be doing something
wrong because it doesn't seem right. For instance it is listing a
"Windows Forms" section on the toolbox rather than the "Web Forms"
section that I need. Also there is no html section on the designer.
I must have gone off track somewhere... Any help you can provide
would be greatly appreciated. Thanks!On Jun 27, 10:55 pm, mbosc...@.hotmail.com wrote:
> Hi, I created a user control within my asp.net application. It has
> an .ascx extension. I use this control many times within this
> application and it works fine. I wrote this user control to be
> generic though, because I want it to be accessible from other asp.net
> applications as well. How do I break out the user control into a
> seperate dll that can be references by many asp.net apps? I fooled
> around with the "Web Control Library" but I must be doing something
> wrong because it doesn't seem right. For instance it is listing a
> "Windows Forms" section on the toolbox rather than the "Web Forms"
> section that I need. Also there is no html section on the designer.
> I must have gone off track somewhere... Any help you can provide
> would be greatly appreciated. Thanks!
hi... :)
If you want to use your control in multiple projects and you actually
want made it generic enough you have to write a custom control... okay
that good... now you can still use user user control in multiple
project but for this you got to copy the ascx file and its cs file to
the new project...
Thanks
Masudur
http://www.kaz.com.bd
http://munnacs.110mb.com
newbie asp.net user control question
an .ascx extension. I use this control many times within this
application and it works fine. I wrote this user control to be
generic though, because I want it to be accessible from other asp.net
applications as well. How do I break out the user control into a
seperate dll that can be references by many asp.net apps? I fooled
around with the "Web Control Library" but I must be doing something
wrong because it doesn't seem right. For instance it is listing a
"Windows Forms" section on the toolbox rather than the "Web Forms"
section that I need. Also there is no html section on the designer.
I must have gone off track somewhere... Any help you can provide
would be greatly appreciated. Thanks!On Jun 27, 10:55 pm, mbosc...@.hotmail.com wrote:
Quote:
Originally Posted by
Hi, I created a user control within my asp.net application. It has
an .ascx extension. I use this control many times within this
application and it works fine. I wrote this user control to be
generic though, because I want it to be accessible from other asp.net
applications as well. How do I break out the user control into a
seperate dll that can be references by many asp.net apps? I fooled
around with the "Web Control Library" but I must be doing something
wrong because it doesn't seem right. For instance it is listing a
"Windows Forms" section on the toolbox rather than the "Web Forms"
section that I need. Also there is no html section on the designer.
I must have gone off track somewhere... Any help you can provide
would be greatly appreciated. Thanks!
hi... :)
If you want to use your control in multiple projects and you actually
want made it generic enough you have to write a custom control... okay
that good... now you can still use user user control in multiple
project but for this you got to copy the ascx file and its cs file to
the new project...
Thanks
Masudur
http://www.kaz.com.bd
http://munnacs.110mb.com
Newbie authentication question
in desktop application development (C/C++). I am trying to get my head
around key concepts such as authentication, object life cycle etc, and I
seem to be going round in circles. Specifically, I am contemplating how
to do this:
1). Create a website that has role based authentication (forms based) -
i.e. a user enters username/pwd to logon
2). User is shown a set of pages based on his/her role (determined from
login details) - for example admin users have access to admnistrative pages
I was thinking of implementing the Authenication etc by means of an
Application class (a Singleton), and then basically routing all of the
users actions (i.e. clicks etc) through the Application class, which
will check that the user has the permision to do that (ok I am being
paranoid and I don't consider 'hiding' pages/forms etc based on a user's
role sufficient).
The question is this:
1). Is a singleton the appropriate design for this?.
2). Will there be one instance of Application class that will handle all
website users 'requests' or will there be one Application object per
user - since (presumably?) different users run in different
threads/processes ?
Suggestions/tips please ...ASP.NET 2.0 already has built-in Membership, Roles and Profile providers for
handling all these functions. It's all configured in the web.config. You can
also roll your own custom providers that derive from the base classes in the
framework.
Peter
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net
"Bit Byte" wrote:
> I am new to the world of Web development - although I have several years
> in desktop application development (C/C++). I am trying to get my head
> around key concepts such as authentication, object life cycle etc, and I
> seem to be going round in circles. Specifically, I am contemplating how
> to do this:
> 1). Create a website that has role based authentication (forms based) -
> i.e. a user enters username/pwd to logon
> 2). User is shown a set of pages based on his/her role (determined from
> login details) - for example admin users have access to admnistrative page
s
> I was thinking of implementing the Authenication etc by means of an
> Application class (a Singleton), and then basically routing all of the
> users actions (i.e. clicks etc) through the Application class, which
> will check that the user has the permision to do that (ok I am being
> paranoid and I don't consider 'hiding' pages/forms etc based on a user's
> role sufficient).
> The question is this:
> 1). Is a singleton the appropriate design for this?.
> 2). Will there be one instance of Application class that will handle all
> website users 'requests' or will there be one Application object per
> user - since (presumably?) different users run in different
> threads/processes ?
> Suggestions/tips please ...
>
Newbie authentication question
in desktop application development (C/C++). I am trying to get my head
around key concepts such as authentication, object life cycle etc, and I
seem to be going round in circles. Specifically, I am contemplating how
to do this:
1). Create a website that has role based authentication (forms based) -
i.e. a user enters username/pwd to logon
2). User is shown a set of pages based on his/her role (determined from
login details) - for example admin users have access to admnistrative pages
I was thinking of implementing the Authenication etc by means of an
Application class (a Singleton), and then basically routing all of the
users actions (i.e. clicks etc) through the Application class, which
will check that the user has the permision to do that (ok I am being
paranoid and I don't consider 'hiding' pages/forms etc based on a user's
role sufficient).
The question is this:
1). Is a singleton the appropriate design for this?.
2). Will there be one instance of Application class that will handle all
website users 'requests' or will there be one Application object per
user - since (presumably?) different users run in different
threads/processes ?
Suggestions/tips please ...ASP.NET 2.0 already has built-in Membership, Roles and Profile providers for
handling all these functions. It's all configured in the web.config. You can
also roll your own custom providers that derive from the base classes in the
framework.
Peter
--
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net
"Bit Byte" wrote:
Quote:
Originally Posted by
>
I am new to the world of Web development - although I have several years
in desktop application development (C/C++). I am trying to get my head
around key concepts such as authentication, object life cycle etc, and I
seem to be going round in circles. Specifically, I am contemplating how
to do this:
>
1). Create a website that has role based authentication (forms based) -
i.e. a user enters username/pwd to logon
2). User is shown a set of pages based on his/her role (determined from
login details) - for example admin users have access to admnistrative pages
>
I was thinking of implementing the Authenication etc by means of an
Application class (a Singleton), and then basically routing all of the
users actions (i.e. clicks etc) through the Application class, which
will check that the user has the permision to do that (ok I am being
paranoid and I don't consider 'hiding' pages/forms etc based on a user's
role sufficient).
>
The question is this:
>
1). Is a singleton the appropriate design for this?.
2). Will there be one instance of Application class that will handle all
website users 'requests' or will there be one Application object per
user - since (presumably?) different users run in different
threads/processes ?
>
Suggestions/tips please ...
>
Saturday, March 24, 2012
newbie error
Server Error in '/FSTEST' Application.
----
--
Parser Error
Description: An error occurred during the parsing of a resource required to
service this request. Please review the following specific parse error
details and modify your source file appropriately.
Parser Error Message: Could not load type 'FSTEST.Global'.
Source Error:
Line 1: <%@dotnet.itags.org. Application Codebehind="Global.asax.vb"
Inherits="FSTEST.Global" %>
Source File: F:\Inetpub\wwwroot\FSTEST\global.asax Line: 1
----
--
Version Information: Microsoft .NET Framework Version:1.1.4322.2032; ASP.NET
Version:1.1.4322.2032
This is on a line of code generated by Visual Stsudio .Net. What does the
error mean'
MikeMike,
The root directory of your application in IIS is not set as an
"application". The system is looking for the global.asax information in the
root. Open IIS, go to the properties on your website/fstest directory, and
click the "Create" button by the application name.
Ian Suttle
http://www.IanSuttle.com
"Mike D" wrote:
> I am trying to run a simple page and get this error:
> Server Error in '/FSTEST' Application.
> ----
--
> Parser Error
> Description: An error occurred during the parsing of a resource required t
o
> service this request. Please review the following specific parse error
> details and modify your source file appropriately.
> Parser Error Message: Could not load type 'FSTEST.Global'.
> Source Error:
> Line 1: <%@. Application Codebehind="Global.asax.vb"
> Inherits="FSTEST.Global" %>
> Source File: F:\Inetpub\wwwroot\FSTEST\global.asax Line: 1
> ----
--
> Version Information: Microsoft .NET Framework Version:1.1.4322.2032; ASP.N
ET
> Version:1.1.4322.2032
> This is on a line of code generated by Visual Stsudio .Net. What does the
> error mean'
> Mike
Thanks for the reply. Is there anything else it could be. The application
had been created and there was a global.asax file there. I removed then
recreated the application and still the same error. The only line in the
global.asax is"<%@. Application Codebehind="Global.asax.vb"
Inherits="FSTEST.Global" %>"
Thanks
Mike
"Ian Suttle" wrote:
> Mike,
> The root directory of your application in IIS is not set as an
> "application". The system is looking for the global.asax information in t
he
> root. Open IIS, go to the properties on your website/fstest directory, an
d
> click the "Create" button by the application name.
> Ian Suttle
> http://www.IanSuttle.com
> "Mike D" wrote:
>
Hello Mike,
Do you have a file called Global.asax.vb and does it define a class Global
with the namespace FSTEST?
Also, have you compiled to project (ie: is there a bin folder with dlls in
it)?
Matt Berther
http://www.mattberther.com
> Thanks for the reply. Is there anything else it could be. The
> application had been created and there was a global.asax file there.
> I removed then recreated the application and still the same error.
> The only line in the global.asax is"<%@. Application
> Codebehind="Global.asax.vb" Inherits="FSTEST.Global" %>"
> Thanks
> Mike
> "Ian Suttle" wrote:
>
It was simpler than that. I hadn't compiled. I thought aspx was done at ru
n
time the first time the page was requested. I guess this ASP guy has a lot
to learn.
Mike
"Ian Suttle" wrote:
> Mike,
> The root directory of your application in IIS is not set as an
> "application". The system is looking for the global.asax information in t
he
> root. Open IIS, go to the properties on your website/fstest directory, an
d
> click the "Create" button by the application name.
> Ian Suttle
> http://www.IanSuttle.com
> "Mike D" wrote:
>
Ah, that will do it as well :). You are correct in that the ASPX pages
compile at runtime and are stored as temporary DLLs for faster execution.
However, the code behinds are compiled into a DLL (prior to deployment) that
you need to run the application. I'm sure you realize this all by now thoug
h.
Ian Suttle
http://www.IanSuttle.com
"Mike D" wrote:
> It was simpler than that. I hadn't compiled. I thought aspx was done at
run
> time the first time the page was requested. I guess this ASP guy has a lo
t
> to learn.
> Mike
> "Ian Suttle" wrote:
>
It's going to be a switch. I'm sure I'll have more bonehead questions in th
e
future.
Thanks again for your time,
Mike
"Ian Suttle" wrote:
> Ah, that will do it as well :). You are correct in that the ASPX pages
> compile at runtime and are stored as temporary DLLs for faster execution.
> However, the code behinds are compiled into a DLL (prior to deployment) th
at
> you need to run the application. I'm sure you realize this all by now tho
ugh.
> Ian Suttle
> http://www.IanSuttle.com
> "Mike D" wrote:
>
newbie help : application
I'm a newbie and would like to know what Application("classname") does.
thanks.It helps you access an application level variable called "Classname". You can read from it or set it to a value.
Newbie Help (Parser Error)
The default.aspx page simply displays a form and a heading:
PAGE CODE:
------
<%@dotnet.itags.org. Page Language="VB" %>
<html>
<body>
<form id='form1' method='post' runat='server'>
<h1> Welcome to First Application</h1>
<asp:button id='btnNavigate' runat='server' text='Navigate'/>
</form>
</body>
</html
--------
When I run the application I get the following error.
ERROR MESSAGE:
--------
Parser Error
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.
Parser Error Message: Could not load type 'firstapp.Global'.
Source Error:
Line 1: <%@dotnet.itags.org. Application Codebehind="Global.asax.vb" Inherits="firstapp.Global" %
Source File: c:\inetpub\wwwroot\firstapp\global.asax Line: 1
-------------------
I am not sure why. The application was install as an asp.net application on IIS 5.
Any help would be greatly appreciated. My email is tcornett@dotnet.itags.org.ci.kingman.az.us
Thanks,
Terry C.There are several files required for an ASP.NET web app:
1. Your web form(s)
2. The web.config file
3. The Global.asax file
The Global.asax file must define a class called Global, subclassed from httpApplication. It appears that you have defined a Global.asax file and it refers to a code behind file that should define that Global class. Most likely, you have not compiled the file Global.asax.vb into an assembly that is part of your \bin folder. (All .vb files can be compiled into one single assembly. If you are using Visual Studio.net, that should happen automatically, assembling Global.asax is in your solution and it's Build Action property is set to "Compile".)
Thanks Peter.
I did not realize I had to build the solution for such a simple test web application. The book I was using as a reference did not mention that.
Once I built the solution it worked.
Thanks again for the help.
Terry C. :-)
Newbie Help?
I have installed the web matrix and worked through the tutorials. I am currently trying to do the tutorials on creating an application.
I am using c# and created the following default.aspx according to the instructions. When I try to run the default page in the webserver, I get a "specified cast is not valid." error. I searched through the archives and found information on changing the webmatrix.exe.config and the webserver.exe.config to att a startup tag to force the matrix to access the proper version of the .net framework.
I made these changes and still receive the error. Can anyone help me? The code is below with the error point marked.
I don't know for sure what's going on, but you should be able to fix it by doing this:
private void BindMasterGrid() {// TODO: Update the ConnectionString and CommandText values for your application
string ConnectionString = "server=(local);database=Orders;Integrated Security=SSPI";
string CommandText = "select OrderID, OrderDate, CustomerName from Orders";SqlConnection myConnection = new SqlConnection(ConnectionString);
SqlDataAdapter myCommand = new SqlDataAdapter(CommandText, myConnection);DataSet ds = new DataSet();
myCommand.Fill(ds);MasterGrid.DataSource = ds;
MasterGrid.DataBind();
}private void BindDetailGrid() {
// get the filter value from the master Grid's DataKeys collection
if (MasterGrid.SelectedIndex != -1) {
// TODO: update the ConnectionString value for your application
string ConnectionString = "server=(local);database=Orders;Integrated Security=SSPI";// TODO: update the CommandText value for your application
** this is where the error takes place. This line was autogenerated by the matrix and I have changed nothing. The error is: specified cast is not valid.
string filterValue = ((string) MasterGrid.DataKeys[MasterGrid.SelectedIndex]).Replace("'", "''");
string CommandText = "select OrderDetailID, ProductName, Quantity, UnitPrice from OrderDetails where OrderID = '" + filterValue + "'";
SqlConnection myConnection = new SqlConnection(ConnectionString);
SqlCommand myCommand = new SqlCommand(CommandText, myConnection);myConnection.Open();
DetailsGrid.DataSource = myCommand.ExecuteReader(CommandBehavior.CloseConnection);
}DetailsGrid.DataBind();
}
string filterValue = (MasterGrid.DataKeys[MasterGrid.SelectedIndex].ToString());IOW, use ToString() to perform the casting then break the Replace method off into another line. Works for me, anyway. I'll ask, see if anyone knows why this is.
filterValue = filterValue.Replace("'", "''");
Thank you for your help. My gut reaction was to try .ToString(), but I didn't know if that was the same thing as the cast (string). You're right. It worked fine this way. Thanks so much for answering.
Got the answer, I think. One of my colleagues said this:
"The DataKeys collection doesn't necessarily contain objects of type String. It depends on the data type of the key field specified by the DatatKeyField property. If the key field is an integer value, then the DataKeys collection contains Int32 objects. That's why the ToString() method always works, but casting doesn't. ToString() always returns the string representation of the key value.
Sounds like that's a bug in Web Matrix. It's assuming that the key field is a string, which may not always be the case."
I suppose it is a bug, then; it doesn't get uncovered, however, unless (as here) we change the database that the template points to. Presumably it works with Pubs. (?)
Thursday, March 22, 2012
Newbie IIS6/ASP.net problem
development. I then chose the Application server role and loaded IIS 6
making sure to enable ASP.NET while I was doing it. I then installed Visual
Studio.NET 2003. Today I was loading some sample files from a C# book I got
from Microsoft Press and got this error from the Windows Development
Environment:
"The Web server reported the following error when attempting to create or
open the web project located at the following URL:
'http://Localhost:/aspnetsbs_cs/Chapter_01/'.'HTTP/1.1 400 Bad Request'.
When I loaded the same sample files on my Win2k Pro machine it came off
without a hitch. I have scoured Microsoft Technet but I seem to be unable to
find anything to explain this. So far I have not been able to get any
classic ASP or ASP.NET pages to run.
If anyone can give me some pointers I would really appreciate it. I imagine,
as usual, that the answer is quite simple. Obviously I am very inexperienced
with IIS and .NET. I usually do MSAccess programming.If nothing runs, open the IIS Administration Console on the Server. Expand
the local computer node, and click on Web Service Extensions. In the right
pane, make sure Active Server Pages and ASP.NET are set to "Allow". Windows
Server 2003, as part of the new security initiative, now disables many
things by default.
--
James J. Foster, DotNetCoders
http://www.dotnetcoders.com
"Michael Kelty" <mkelty@.hotmail.com> wrote in message
news:befe00$bnv$1@.news1.radix.net...
> Yesterday I installed Windows Server 2003 onto a computer for testing and
> development. I then chose the Application server role and loaded IIS 6
> making sure to enable ASP.NET while I was doing it. I then installed
Visual
> Studio.NET 2003. Today I was loading some sample files from a C# book I
got
> from Microsoft Press and got this error from the Windows Development
> Environment:
> "The Web server reported the following error when attempting to create or
> open the web project located at the following URL:
> 'http://Localhost:/aspnetsbs_cs/Chapter_01/'.'HTTP/1.1 400 Bad Request'.
> When I loaded the same sample files on my Win2k Pro machine it came off
> without a hitch. I have scoured Microsoft Technet but I seem to be unable
to
> find anything to explain this. So far I have not been able to get any
> classic ASP or ASP.NET pages to run.
> If anyone can give me some pointers I would really appreciate it. I
imagine,
> as usual, that the answer is quite simple. Obviously I am very
inexperienced
> with IIS and .NET. I usually do MSAccess programming.
>
"James J. Foster" <james@.dotnetcoders.com> wrote in message
news:%23CeQHSbRDHA.2224@.TK2MSFTNGP12.phx.gbl...
> If nothing runs, open the IIS Administration Console on the Server. Expand
> the local computer node, and click on Web Service Extensions. In the right
> pane, make sure Active Server Pages and ASP.NET are set to "Allow".
Windows
> Server 2003, as part of the new security initiative, now disables many
> things by default.
> --
> James J. Foster, DotNetCoders
> http://www.dotnetcoders.com
Thanks but the Server console is set to "Allow" for both Active Server Pages
and ASP.NET. I'm still at a standstill without a clue.
Perhaps bagging the idea of using Win2k3 and IIS 6 altogether and going with
Windows 2000 server would be better, no? The site I am eventually going to
set up will be in an intranet setting so security shouldn't be too much of a
problem (famous last words).
> "Michael Kelty" <mkelty@.hotmail.com> wrote in message
> news:befe00$bnv$1@.news1.radix.net...
> > Yesterday I installed Windows Server 2003 onto a computer for testing
and
> > development. I then chose the Application server role and loaded IIS 6
> > making sure to enable ASP.NET while I was doing it. I then installed
> Visual
> > Studio.NET 2003. Today I was loading some sample files from a C# book I
> got
> > from Microsoft Press and got this error from the Windows Development
> > Environment:
> > "The Web server reported the following error when attempting to create
or
> > open the web project located at the following URL:
> > 'http://Localhost:/aspnetsbs_cs/Chapter_01/'.'HTTP/1.1 400 Bad Request'.
> > When I loaded the same sample files on my Win2k Pro machine it came off
> > without a hitch. I have scoured Microsoft Technet but I seem to be
unable
> to
> > find anything to explain this. So far I have not been able to get any
> > classic ASP or ASP.NET pages to run.
> > If anyone can give me some pointers I would really appreciate it. I
> imagine,
> > as usual, that the answer is quite simple. Obviously I am very
> inexperienced
> > with IIS and .NET. I usually do MSAccess programming.
Hi Michael,
Please go to IIS configuration->Default web site->Properties->select "web
site" tab. There is a IP address setting. Did you set it to an IP address?
If so, please change it back to (all unassigned).
If this setting is set as an IP address, then localhost(127.0.0.1) can't be
resolved by IIS and so you couldn't visit any site in http://localhost.
Please post here if the problem is not resolved. Thanks.
Best regards,
yhhuang
VS.NET, Visual C++
Microsoft
This posting is provided "AS IS" with no warranties, and confers no rights.
Got .Net? http://www.gotdotnet.com
-------
!From: "Michael Kelty" <mkelty@.hotmail.com>
!Newsgroups: microsoft.public.dotnet.framework.aspnet
!Subject: Re: Newbie IIS6/ASP.net problem
!Date: Wed, 9 Jul 2003 10:32:18 -0400
!Organization: RadixNet Internet Services
!Lines: 60
!Message-ID: <beh91k$4i$1@.news1.radix.net>
!References: <befe00$bnv$1@.news1.radix.net>
<#CeQHSbRDHA.2224@.TK2MSFTNGP12.phx.gbl>
!NNTP-Posting-Host: ip5.ci.alexandria.va.us
!X-Priority: 3
!X-MSMail-Priority: Normal
!X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
!X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
!Path:
cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed 00.sul.t-online.de!t-onlin
e.de!npeer.de.kpn-eurorings.net!news-out.nuthinbutnews.com!propagator2-sterl
ing!news-in-sterling.newsfeed.com!tdsnet-transit!newspeer.tds.net!newspeer.r
adix.net!news1.radix.net!not-for-mail
!Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.aspnet:158011
!X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
!
!
!"James J. Foster" <james@.dotnetcoders.com> wrote in message
!news:%23CeQHSbRDHA.2224@.TK2MSFTNGP12.phx.gbl...
!> If nothing runs, open the IIS Administration Console on the Server.
Expand
!> the local computer node, and click on Web Service Extensions. In the
right
!> pane, make sure Active Server Pages and ASP.NET are set to "Allow".
!Windows
!> Server 2003, as part of the new security initiative, now disables many
!> things by default.
!>
!> --
!> James J. Foster, DotNetCoders
!> http://www.dotnetcoders.com
!
!Thanks but the Server console is set to "Allow" for both Active Server
Pages
!and ASP.NET. I'm still at a standstill without a clue.
!
!Perhaps bagging the idea of using Win2k3 and IIS 6 altogether and going
with
!Windows 2000 server would be better, no? The site I am eventually going to
!set up will be in an intranet setting so security shouldn't be too much of
a
!problem (famous last words).
!
!
!> "Michael Kelty" <mkelty@.hotmail.com> wrote in message
!> news:befe00$bnv$1@.news1.radix.net...
!> > Yesterday I installed Windows Server 2003 onto a computer for testing
!and
!> > development. I then chose the Application server role and loaded IIS 6
!> > making sure to enable ASP.NET while I was doing it. I then installed
!> Visual
!> > Studio.NET 2003. Today I was loading some sample files from a C# book I
!> got
!> > from Microsoft Press and got this error from the Windows Development
!> > Environment:
!!> > "The Web server reported the following error when attempting to create
!or
!> > open the web project located at the following URL:
!> > 'http://Localhost:/aspnetsbs_cs/Chapter_01/'.'HTTP/1.1 400 Bad
Request'.
!!> > When I loaded the same sample files on my Win2k Pro machine it came off
!> > without a hitch. I have scoured Microsoft Technet but I seem to be
!unable
!> to
!> > find anything to explain this. So far I have not been able to get any
!> > classic ASP or ASP.NET pages to run.
!!> > If anyone can give me some pointers I would really appreciate it. I
!> imagine,
!> > as usual, that the answer is quite simple. Obviously I am very
!> inexperienced
!> > with IIS and .NET. I usually do MSAccess programming.
!!!!!>
!>
!
!
!
"Yan-Hong Huang[MSFT]" <yhhuang@.online.microsoft.com> wrote in message
news:oWiukoqRDHA.2192@.cpmsftngxa06.phx.gbl...
> Hi Michael,
> Please go to IIS configuration->Default web site->Properties->select "web
> site" tab. There is a IP address setting. Did you set it to an IP address?
> If so, please change it back to (all unassigned).
> If this setting is set as an IP address, then localhost(127.0.0.1) can't
be
> resolved by IIS and so you couldn't visit any site in http://localhost.
> Please post here if the problem is not resolved. Thanks.
> Best regards,
> yhhuang
> VS.NET, Visual C++
> Microsoft
I did as you said and now the error I get is the same except instead of
saying 'Bad Request' it says 'Service Unavailable'. During the course of
trying to get the webserver up and running, I got an error page in IE with
those words on it on several occasions but all the indications that I could
see led me to believe that the website was running.
Sorry to truncate but the thread was getting quite long.
Continuing thanks.
Hi Michael,
Could you creaet a new asp.net web application from application wizard successfully? If not, I think you need to reinstall
asp.net in the system. Please refer to http://support.microsoft.com/?id=306005 for detailed steps. Thanks.
Best regards,
yhhuang
VS.NET, Visual C++
Microsoft
This posting is provided "AS IS" with no warranties, and confers no rights.
Got .Net? http://www.gotdotnet.com
-------
!From: "Michael Kelty" <mkelty@.hotmail.com>
!Newsgroups: microsoft.public.dotnet.framework.aspnet
!Subject: Re: Newbie IIS6/ASP.net problem
!Date: Thu, 10 Jul 2003 14:17:01 -0400
!Organization: RadixNet Internet Services
!Lines: 30
!Message-ID: <bekaiu$k5r$1@.news1.radix.net>
!References: <befe00$bnv$1@.news1.radix.net> <#CeQHSbRDHA.2224@.TK2MSFTNGP12.phx.gbl> <beh91k$4i$1
@.news1.radix.net> <oWiukoqRDHA.2192@.cpmsftngxa06.phx.gbl>
!NNTP-Posting-Host: ip5.ci.alexandria.va.us
!X-Priority: 3
!X-MSMail-Priority: Normal
!X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
!X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
!Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed 00.sul.t-online.de!t-online.de!news-spur1.maxwell.syr.edu!
news.maxwell.syr.edu!news-out1.nntp.be!propagator2-sterling!In.nntp.be!tdsnet-transit!newspeer.tds.net!
newspeer.radix.net!news1.radix.net!not-for-mail
!Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.aspnet:158373
!X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
!
!
!"Yan-Hong Huang[MSFT]" <yhhuang@.online.microsoft.com> wrote in message
!news:oWiukoqRDHA.2192@.cpmsftngxa06.phx.gbl...
!> Hi Michael,
!>
!> Please go to IIS configuration->Default web site->Properties->select "web
!> site" tab. There is a IP address setting. Did you set it to an IP address?
!> If so, please change it back to (all unassigned).
!>
!> If this setting is set as an IP address, then localhost(127.0.0.1) can't
!be
!> resolved by IIS and so you couldn't visit any site in http://localhost.
!>
!> Please post here if the problem is not resolved. Thanks.
!>
!> Best regards,
!> yhhuang
!> VS.NET, Visual C++
!> Microsoft
!
!I did as you said and now the error I get is the same except instead of
!saying 'Bad Request' it says 'Service Unavailable'. During the course of
!trying to get the webserver up and running, I got an error page in IE with
!those words on it on several occasions but all the indications that I could
!see led me to believe that the website was running.
!
!Sorry to truncate but the thread was getting quite long.
!Continuing thanks.
!
!
!
Hi Michael,
Could you creaet a new asp.net web application from application wizard successfully? If not, I think you need to reinstall
asp.net in the system. Please refer to http://support.microsoft.com/?id=306005 for detailed steps. Thanks.
Best regards,
yhhuang
VS.NET, Visual C++
Microsoft
This posting is provided "AS IS" with no warranties, and confers no rights.
Got .Net? http://www.gotdotnet.com
-------
!From: "Michael Kelty" <mkelty@.hotmail.com>
!Newsgroups: microsoft.public.dotnet.framework.aspnet
!Subject: Re: Newbie IIS6/ASP.net problem
!Date: Thu, 10 Jul 2003 14:17:01 -0400
!Organization: RadixNet Internet Services
!Lines: 30
!Message-ID: <bekaiu$k5r$1@.news1.radix.net>
!References: <befe00$bnv$1@.news1.radix.net> <#CeQHSbRDHA.2224@.TK2MSFTNGP12.phx.gbl> <beh91k$4i$1
@.news1.radix.net> <oWiukoqRDHA.2192@.cpmsftngxa06.phx.gbl>
!NNTP-Posting-Host: ip5.ci.alexandria.va.us
!X-Priority: 3
!X-MSMail-Priority: Normal
!X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
!X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
!Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed 00.sul.t-online.de!t-online.de!news-spur1.maxwell.syr.edu!
news.maxwell.syr.edu!news-out1.nntp.be!propagator2-sterling!In.nntp.be!tdsnet-transit!newspeer.tds.net!
newspeer.radix.net!news1.radix.net!not-for-mail
!Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.aspnet:158373
!X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
!
!
!"Yan-Hong Huang[MSFT]" <yhhuang@.online.microsoft.com> wrote in message
!news:oWiukoqRDHA.2192@.cpmsftngxa06.phx.gbl...
!> Hi Michael,
!>
!> Please go to IIS configuration->Default web site->Properties->select "web
!> site" tab. There is a IP address setting. Did you set it to an IP address?
!> If so, please change it back to (all unassigned).
!>
!> If this setting is set as an IP address, then localhost(127.0.0.1) can't
!be
!> resolved by IIS and so you couldn't visit any site in http://localhost.
!>
!> Please post here if the problem is not resolved. Thanks.
!>
!> Best regards,
!> yhhuang
!> VS.NET, Visual C++
!> Microsoft
!
!I did as you said and now the error I get is the same except instead of
!saying 'Bad Request' it says 'Service Unavailable'. During the course of
!trying to get the webserver up and running, I got an error page in IE with
!those words on it on several occasions but all the indications that I could
!see led me to believe that the website was running.
!
!Sorry to truncate but the thread was getting quite long.
!Continuing thanks.
!
!
!
Excellent, thank you.
"Yan-Hong Huang[MSFT]" <yhhuang@.online.microsoft.com> wrote in message
news:brtQ3afSDHA.1928@.cpmsftngxa06.phx.gbl...
> Hi Michael,
> Could you creaet a new asp.net web application from application wizard
successfully? If not, I think you need to reinstall
> asp.net in the system. Please refer to
http://support.microsoft.com/?id=306005 for detailed steps. Thanks.
> Best regards,
> yhhuang
> VS.NET, Visual C++
> Microsoft
> This posting is provided "AS IS" with no warranties, and confers no
rights.
> Got .Net? http://www.gotdotnet.com
> -------
> !From: "Michael Kelty" <mkelty@.hotmail.com>
> !Newsgroups: microsoft.public.dotnet.framework.aspnet
> !Subject: Re: Newbie IIS6/ASP.net problem
> !Date: Thu, 10 Jul 2003 14:17:01 -0400
> !Organization: RadixNet Internet Services
> !Lines: 30
> !Message-ID: <bekaiu$k5r$1@.news1.radix.net>
> !References: <befe00$bnv$1@.news1.radix.net>
<#CeQHSbRDHA.2224@.TK2MSFTNGP12.phx.gbl> <beh91k$4i$1
> @.news1.radix.net> <oWiukoqRDHA.2192@.cpmsftngxa06.phx.gbl>
> !NNTP-Posting-Host: ip5.ci.alexandria.va.us
> !X-Priority: 3
> !X-MSMail-Priority: Normal
> !X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
> !X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
> !Path:
cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed 00.sul.t-online.de!t-onlin
e.de!news-spur1.maxwell.syr.edu!
news.maxwell.syr.edu!news-out1.nntp.be!propagator2-sterling!In.nntp.be!tdsne
t-transit!newspeer.tds.net!
> newspeer.radix.net!news1.radix.net!not-for-mail
> !Xref: cpmsftngxa06.phx.gbl
microsoft.public.dotnet.framework.aspnet:158373
> !X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
> !
> !
> !"Yan-Hong Huang[MSFT]" <yhhuang@.online.microsoft.com> wrote in message
> !news:oWiukoqRDHA.2192@.cpmsftngxa06.phx.gbl...
> !> Hi Michael,
> !>
> !> Please go to IIS configuration->Default web site->Properties->select
"web
> !> site" tab. There is a IP address setting. Did you set it to an IP
address?
> !> If so, please change it back to (all unassigned).
> !>
> !> If this setting is set as an IP address, then localhost(127.0.0.1)
can't
> !be
> !> resolved by IIS and so you couldn't visit any site in http://localhost.
> !>
> !> Please post here if the problem is not resolved. Thanks.
> !>
> !> Best regards,
> !> yhhuang
> !> VS.NET, Visual C++
> !> Microsoft
> !
> !I did as you said and now the error I get is the same except instead of
> !saying 'Bad Request' it says 'Service Unavailable'. During the course of
> !trying to get the webserver up and running, I got an error page in IE
with
> !those words on it on several occasions but all the indications that I
could
> !see led me to believe that the website was running.
> !
> !Sorry to truncate but the thread was getting quite long.
> !Continuing thanks.
> !
> !
> !
Excellent, thank you.
"Yan-Hong Huang[MSFT]" <yhhuang@.online.microsoft.com> wrote in message
news:brtQ3afSDHA.1928@.cpmsftngxa06.phx.gbl...
> Hi Michael,
> Could you creaet a new asp.net web application from application wizard
successfully? If not, I think you need to reinstall
> asp.net in the system. Please refer to
http://support.microsoft.com/?id=306005 for detailed steps. Thanks.
> Best regards,
> yhhuang
> VS.NET, Visual C++
> Microsoft
> This posting is provided "AS IS" with no warranties, and confers no
rights.
> Got .Net? http://www.gotdotnet.com
> -------
> !From: "Michael Kelty" <mkelty@.hotmail.com>
> !Newsgroups: microsoft.public.dotnet.framework.aspnet
> !Subject: Re: Newbie IIS6/ASP.net problem
> !Date: Thu, 10 Jul 2003 14:17:01 -0400
> !Organization: RadixNet Internet Services
> !Lines: 30
> !Message-ID: <bekaiu$k5r$1@.news1.radix.net>
> !References: <befe00$bnv$1@.news1.radix.net>
<#CeQHSbRDHA.2224@.TK2MSFTNGP12.phx.gbl> <beh91k$4i$1
> @.news1.radix.net> <oWiukoqRDHA.2192@.cpmsftngxa06.phx.gbl>
> !NNTP-Posting-Host: ip5.ci.alexandria.va.us
> !X-Priority: 3
> !X-MSMail-Priority: Normal
> !X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
> !X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
> !Path:
cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed 00.sul.t-online.de!t-onlin
e.de!news-spur1.maxwell.syr.edu!
news.maxwell.syr.edu!news-out1.nntp.be!propagator2-sterling!In.nntp.be!tdsne
t-transit!newspeer.tds.net!
> newspeer.radix.net!news1.radix.net!not-for-mail
> !Xref: cpmsftngxa06.phx.gbl
microsoft.public.dotnet.framework.aspnet:158373
> !X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
> !
> !
> !"Yan-Hong Huang[MSFT]" <yhhuang@.online.microsoft.com> wrote in message
> !news:oWiukoqRDHA.2192@.cpmsftngxa06.phx.gbl...
> !> Hi Michael,
> !>
> !> Please go to IIS configuration->Default web site->Properties->select
"web
> !> site" tab. There is a IP address setting. Did you set it to an IP
address?
> !> If so, please change it back to (all unassigned).
> !>
> !> If this setting is set as an IP address, then localhost(127.0.0.1)
can't
> !be
> !> resolved by IIS and so you couldn't visit any site in http://localhost.
> !>
> !> Please post here if the problem is not resolved. Thanks.
> !>
> !> Best regards,
> !> yhhuang
> !> VS.NET, Visual C++
> !> Microsoft
> !
> !I did as you said and now the error I get is the same except instead of
> !saying 'Bad Request' it says 'Service Unavailable'. During the course of
> !trying to get the webserver up and running, I got an error page in IE
with
> !those words on it on several occasions but all the indications that I
could
> !see led me to believe that the website was running.
> !
> !Sorry to truncate but the thread was getting quite long.
> !Continuing thanks.
> !
> !
> !