Showing posts with label project. Show all posts
Showing posts with label project. Show all posts

Thursday, March 29, 2012

newbie: How do I add a project....

Hey

visual studio 2005

I have a asp.net 2.0 project and a class library project. Both projects
created in visual studio 2005. I want to add the class library project to
the asp.net 2.0 project.

I want to add the library project so that I can reference the project,
instead of the compiled file...

I've already tryed to using the "Add Existing Item..." window in the asp.net
2.0 project, which only added the file I selected (.sln file). I don't think
this is the correct way of doing it...

Any suggestions?

JeffHi Jeff,

File->Open Project/Solution and remember to mark Add to solution instead
of Close solution.

On Thu, 14 Sep 2006 12:06:10 +0200, Jeff
<it_consultant1@.hotmail.com.NOSPAMwrote:

Quote:

Originally Posted by

Hey
>
visual studio 2005
>
I have a asp.net 2.0 project and a class library project. Both projects
created in visual studio 2005. I want to add the class library project to
the asp.net 2.0 project.
>
I want to add the library project so that I can reference the project,
instead of the compiled file...
>
I've already tryed to using the "Add Existing Item..." window in the
asp.net
2.0 project, which only added the file I selected (.sln file). I don't
think
this is the correct way of doing it...
>
Any suggestions?
>
Jeff
>
>


--
Happy Coding!
Morten Wennevik [C# MVP]
thanks

"Morten Wennevik" <MortenWennevik@.hotmail.comwrote in message
news:op.tfu46bz6klbvpo@.tr024.bouvet.no...

Quote:

Originally Posted by

Hi Jeff,
>
File->Open Project/Solution and remember to mark Add to solution instead
of Close solution.
>
>
>
On Thu, 14 Sep 2006 12:06:10 +0200, Jeff
<it_consultant1@.hotmail.com.NOSPAMwrote:
>

Quote:

Originally Posted by

>Hey
>>
>visual studio 2005
>>
>I have a asp.net 2.0 project and a class library project. Both projects
>created in visual studio 2005. I want to add the class library project to
>the asp.net 2.0 project.
>>
>I want to add the library project so that I can reference the project,
>instead of the compiled file...
>>
>I've already tryed to using the "Add Existing Item..." window in the
>asp.net
>2.0 project, which only added the file I selected (.sln file). I don't
>think
>this is the correct way of doing it...
>>
>Any suggestions?
>>
>Jeff
>>
>>


>
>
>
--
Happy Coding!
Morten Wennevik [C# MVP]

newbie: how do I? <export table to sql script>

Hey

I've created a simple asp.net 2.0 (visual studio 2005) project containing a
database in the App_Data folder

I wonder how I can export individual tables from this database to sql
script...

Any suggestions?

JeffOkay, I've sold this by using Sql Express 2005 Managment Tool

"Jeff" <it_consultant1@.hotmail.com.NOSPAMwrote in message
news:%23EHhcDF%23GHA.4696@.TK2MSFTNGP05.phx.gbl...

Quote:

Originally Posted by

Hey
>
I've created a simple asp.net 2.0 (visual studio 2005) project containing
a database in the App_Data folder
>
I wonder how I can export individual tables from this database to sql
script...
>
Any suggestions?
>
Jeff
>


I mean solved it... :-)

"Jeff" <it_consultant1@.hotmail.com.NOSPAMwrote in message
news:%23TnApCG%23GHA.748@.TK2MSFTNGP02.phx.gbl...

Quote:

Originally Posted by

Okay, I've sold this by using Sql Express 2005 Managment Tool
>
"Jeff" <it_consultant1@.hotmail.com.NOSPAMwrote in message
news:%23EHhcDF%23GHA.4696@.TK2MSFTNGP05.phx.gbl...

Quote:

Originally Posted by

>Hey
>>
>I've created a simple asp.net 2.0 (visual studio 2005) project containing
>a database in the App_Data folder
>>
>I wonder how I can export individual tables from this database to sql
>script...
>>
>Any suggestions?
>>
>Jeff
>>


>
>

newbie: how do I? <export table to sql script>

Hey
I've created a simple asp.net 2.0 (visual studio 2005) project containing a
database in the App_Data folder
I wonder how I can export individual tables from this database to sql
script...
Any suggestions?
JeffOkay, I've sold this by using Sql Express 2005 Managment Tool
"Jeff" <it_consultant1@.hotmail.com.NOSPAM> wrote in message
news:%23EHhcDF%23GHA.4696@.TK2MSFTNGP05.phx.gbl...
> Hey
> I've created a simple asp.net 2.0 (visual studio 2005) project containing
> a database in the App_Data folder
> I wonder how I can export individual tables from this database to sql
> script...
> Any suggestions?
> Jeff
>
I mean solved it... :-)
"Jeff" <it_consultant1@.hotmail.com.NOSPAM> wrote in message
news:%23TnApCG%23GHA.748@.TK2MSFTNGP02.phx.gbl...
> Okay, I've sold this by using Sql Express 2005 Managment Tool
> "Jeff" <it_consultant1@.hotmail.com.NOSPAM> wrote in message
> news:%23EHhcDF%23GHA.4696@.TK2MSFTNGP05.phx.gbl...
>

Newbie: how to navigate from one to another asp in the project

Hallo everybody!
I have two asp-pages in my project.
There is a task on the first one, when the solution of the task ok, then
should the second page come. I made a menu for this. If the task solution
ok, then becomes the menu visible. Is it possible to activate automatically
the menu if the task solution ok? I mean, without the click on it? It it
possible to do all this simplier? I think somethink like this:

Protected Sub Button3_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Button3.Click

If MySolution=true then

MySecondASPpage should be shown (what to entere here??)

end if

end sub

Thanks

BarbaraYou may want to use Response.Redirect("PageNameHere")

- V
Barbara Schmidt wrote:

Quote:

Originally Posted by

Hallo everybody!
I have two asp-pages in my project.
There is a task on the first one, when the solution of the task ok, then
should the second page come. I made a menu for this. If the task solution
ok, then becomes the menu visible. Is it possible to activate automatically
the menu if the task solution ok? I mean, without the click on it? It it
possible to do all this simplier? I think somethink like this:
>
Protected Sub Button3_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Button3.Click
>
If MySolution=true then
>
MySecondASPpage should be shown (what to entere here??)
>
end if
>
end sub
>
>
>
Thanks
>
Barbara

newbie: I don't want my .aspx and .cs files to have the source viewable by the client

I'm creating a C# .net project, for a client. However they only have the
right to the binaries, not the source code. Is there a way to compile it so
that I just give them dll's? or do they need the .aspx pages. I read
somewhere that I could probably make assemblies (excuse my bad terminology)
of the source code, but that it is quiet easy to disassemble the assemblies,
so that does not seem to afford read protection.
or am I just all over nothing!
thanksYou need to give them the ASPX pages and the compiled DLLs, but you do not
need to give them the .CS source code files.
If they are unethical they could decombile the DLLs to get a rough
approximation of the source code, but you can thwart them with an
Obfuscator.
Visual Studio 2003 has a basic built in obfuscator, but for 2002 you'll need
a 3rd party solution.
Here's more information on obfuscators:
http://www.abderaware.com/WhitePapers/Obfuscator.htm
http://www.preemptive.com/dotfuscator/index.html
http://www.devx.com/SummitDays/Article/11351
http://www.lesser-software.com/ilobf.htm
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
"Seth Broomer" <asdf@.asdsd.com> wrote in message
news:eWLgn06jEHA.1656@.TK2MSFTNGP09.phx.gbl...
> I'm creating a C# .net project, for a client. However they only have the
> right to the binaries, not the source code. Is there a way to compile it
> so
> that I just give them dll's? or do they need the .aspx pages. I read
> somewhere that I could probably make assemblies (excuse my bad
> terminology)
> of the source code, but that it is quiet easy to disassemble the
> assemblies,
> so that does not seem to afford read protection.
> or am I just all over nothing!
> thanks
>

newbie: I dont want my .aspx and .cs files to have the source viewable by the client

I'm creating a C# .net project, for a client. However they only have the
right to the binaries, not the source code. Is there a way to compile it so
that I just give them dll's? or do they need the .aspx pages. I read
somewhere that I could probably make assemblies (excuse my bad terminology)
of the source code, but that it is quiet easy to disassemble the assemblies,
so that does not seem to afford read protection.

or am I just all confused over nothing!

thanksYou need to give them the ASPX pages and the compiled DLLs, but you do not
need to give them the .CS source code files.
If they are unethical they could decombile the DLLs to get a rough
approximation of the source code, but you can thwart them with an
Obfuscator.
Visual Studio 2003 has a basic built in obfuscator, but for 2002 you'll need
a 3rd party solution.

Here's more information on obfuscators:
http://www.abderaware.com/WhitePapers/Obfuscator.htm
http://www.preemptive.com/dotfuscator/index.html
http://www.devx.com/SummitDays/Article/11351
http://www.lesser-software.com/ilobf.htm

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net

"Seth Broomer" <asdf@.asdsd.com> wrote in message
news:eWLgn06jEHA.1656@.TK2MSFTNGP09.phx.gbl...
> I'm creating a C# .net project, for a client. However they only have the
> right to the binaries, not the source code. Is there a way to compile it
> so
> that I just give them dll's? or do they need the .aspx pages. I read
> somewhere that I could probably make assemblies (excuse my bad
> terminology)
> of the source code, but that it is quiet easy to disassemble the
> assemblies,
> so that does not seem to afford read protection.
> or am I just all confused over nothing!
> thanks
FYI - Just remember there are Deobfuscator out there. But at least you are
taking some sort of measure to secure the DLLs.

"Steve C. Orr [MVP, MCSD]" wrote:

> You need to give them the ASPX pages and the compiled DLLs, but you do not
> need to give them the .CS source code files.
> If they are unethical they could decombile the DLLs to get a rough
> approximation of the source code, but you can thwart them with an
> Obfuscator.
> Visual Studio 2003 has a basic built in obfuscator, but for 2002 you'll need
> a 3rd party solution.
> Here's more information on obfuscators:
> http://www.abderaware.com/WhitePapers/Obfuscator.htm
> http://www.preemptive.com/dotfuscator/index.html
> http://www.devx.com/SummitDays/Article/11351
> http://www.lesser-software.com/ilobf.htm
> --
> I hope this helps,
> Steve C. Orr, MCSD, MVP
> http://Steve.Orr.net
>
> "Seth Broomer" <asdf@.asdsd.com> wrote in message
> news:eWLgn06jEHA.1656@.TK2MSFTNGP09.phx.gbl...
> > I'm creating a C# .net project, for a client. However they only have the
> > right to the binaries, not the source code. Is there a way to compile it
> > so
> > that I just give them dll's? or do they need the .aspx pages. I read
> > somewhere that I could probably make assemblies (excuse my bad
> > terminology)
> > of the source code, but that it is quiet easy to disassemble the
> > assemblies,
> > so that does not seem to afford read protection.
> > or am I just all confused over nothing!
> > thanks
>

Monday, March 26, 2012

newbie: problem with master pages!

Hey
I'm creating a simple helloworld project in visual web developer 2005
express
In my my project I've created a simple master page, that contains 1 table (3
rows x 3 columns) and 1 contentplaceholder. The contentplaceholder is placed
at row 2, column 2 (that means it's in the centre cell in the table)...
After creating the master mage, I then created a new web page that uses this
master page. In this web page I added a calendar. But my PROBLEM occur when
I run this website, the calendar is then placed a bit offset to the
left..See this link, and you see what I mean:
http://home.online.no/~au-holme/pub/66404/ (I'm using those different colors
to see where all the table cells goes) As mentioned above the
contentplaceholder is in the second row, seconds column.. but here the
contentplaceholder uses parts of column 1...
I want contentplaceholder to be in column 2, row 2, not like this (column 2
+ COLUMN 1, row 2)
What am I doing wrong here?
Maybe it's a bad idea to position contentplaceholder using tables?
Maybe Panel should be used instead for position contentplaceholder?
Best Regards
JeffLearn CSS Jeff. It solves all these problems but note if you are using
Themes or StyleSheetThemes with your MasterPage.
For now try to wrap your calendar in a div and play with the margin
values...
<div style="margin: .25em .25em .25em .25em">
<asp:Calendar ... />
</div>
<%= Clinton Gallagher
NET csgallagher AT metromilwaukee.com
URL http://www.metromilwaukee.com/clintongallagher/
"Jeff" <it_consultant1@.hotmail.com.NOSPAM> wrote in message
news:%23iTacEhmGHA.3732@.TK2MSFTNGP05.phx.gbl...
> Hey
> I'm creating a simple helloworld project in visual web developer 2005
> express
> In my my project I've created a simple master page, that contains 1 table
> (3 rows x 3 columns) and 1 contentplaceholder. The contentplaceholder is
> placed at row 2, column 2 (that means it's in the centre cell in the
> table)...
> After creating the master mage, I then created a new web page that uses
> this master page. In this web page I added a calendar. But my PROBLEM
> occur when I run this website, the calendar is then placed a bit offset to
> the left..See this link, and you see what I mean:
> http://home.online.no/~au-holme/pub/66404/ (I'm using those different
> colors to see where all the table cells goes) As mentioned above the
> contentplaceholder is in the second row, seconds column.. but here the
> contentplaceholder uses parts of column 1...
> I want contentplaceholder to be in column 2, row 2, not like this (column
> 2 + COLUMN 1, row 2)
> What am I doing wrong here?
> Maybe it's a bad idea to position contentplaceholder using tables?
> Maybe Panel should be used instead for position contentplaceholder?
> Best Regards
> Jeff
>

newbie: problem with master pages!

Hey

I'm creating a simple helloworld project in visual web developer 2005
express

In my my project I've created a simple master page, that contains 1 table (3
rows x 3 columns) and 1 contentplaceholder. The contentplaceholder is placed
at row 2, column 2 (that means it's in the centre cell in the table)...

After creating the master mage, I then created a new web page that uses this
master page. In this web page I added a calendar. But my PROBLEM occur when
I run this website, the calendar is then placed a bit offset to the
left..See this link, and you see what I mean:
http://home.online.no/~au-holme/pub/66404/ (I'm using those different colors
to see where all the table cells goes) As mentioned above the
contentplaceholder is in the second row, seconds column.. but here the
contentplaceholder uses parts of column 1...

I want contentplaceholder to be in column 2, row 2, not like this (column 2
+ COLUMN 1, row 2)

What am I doing wrong here?

Maybe it's a bad idea to position contentplaceholder using tables?

Maybe Panel should be used instead for position contentplaceholder?

Best Regards

JeffLearn CSS Jeff. It solves all these problems but note if you are using
Themes or StyleSheetThemes with your MasterPage.

For now try to wrap your calendar in a div and play with the margin
values...

<div style="margin: .25em .25em .25em .25em">
<asp:Calendar ... />
</div
<%= Clinton Gallagher
NET csgallagher AT metromilwaukee.com
URL http://www.metromilwaukee.com/clintongallagher/

"Jeff" <it_consultant1@.hotmail.com.NOSPAM> wrote in message
news:%23iTacEhmGHA.3732@.TK2MSFTNGP05.phx.gbl...
> Hey
> I'm creating a simple helloworld project in visual web developer 2005
> express
> In my my project I've created a simple master page, that contains 1 table
> (3 rows x 3 columns) and 1 contentplaceholder. The contentplaceholder is
> placed at row 2, column 2 (that means it's in the centre cell in the
> table)...
> After creating the master mage, I then created a new web page that uses
> this master page. In this web page I added a calendar. But my PROBLEM
> occur when I run this website, the calendar is then placed a bit offset to
> the left..See this link, and you see what I mean:
> http://home.online.no/~au-holme/pub/66404/ (I'm using those different
> colors to see where all the table cells goes) As mentioned above the
> contentplaceholder is in the second row, seconds column.. but here the
> contentplaceholder uses parts of column 1...
> I want contentplaceholder to be in column 2, row 2, not like this (column
> 2 + COLUMN 1, row 2)
> What am I doing wrong here?
> Maybe it's a bad idea to position contentplaceholder using tables?
> Maybe Panel should be used instead for position contentplaceholder?
> Best Regards
> Jeff

Saturday, March 24, 2012

Newbie: Upload large file from client to server in ASP.NET

I have seen many posts for this same subject, but my project has some
odd requirements. I need to develop an ASP app that will upload a
large file (200 MB+) to a server without any user interaction, meaning
I can's simply put a file input box on the page and let the user
choose the file. I basically need them to click a button and have the
file transferred. I know that this would be a dangerous practice if
anyone could do it, but is it possible in a controlled environment?
Because of the size of the file I have been looking at FTPing it, but
can't figure out how to get client script to start the FTP. I have
also found this code (below) that utilizes a web service, but I don't
see how the client-script would get the file from the client since it
appears to be ASP. Any ideas for this situation would be MUCH
appreciated.

<WebMethod()> PublicFunction UploadFile(ByVal fs()AsByte,ByVal
FlNameAsString)AsString
Try
Dim m As New MemoryStream(fs)
Dim f As New FileStream("c:\tempUploaded\" & FlName,
FileMode.Create)
m.WriteTo(f)
m.Close()
f.Close()
f = Nothing
m = Nothing
Return "File Uploaded"

Catch ex As Exception
Return ex.Message
End Try
End Function

The UploadFile Webmethod accepts a byte array and the name of the
file, the byte array is copied to a memory stream which is written to
a FileStream.

The client code to upload a file,

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Try
Dim f As System.IO.File
Dim fs As System.IO.FileStream
Dim o As New localhost.Service1()
'file to upload
fs = f.Open("c:\upload.pdf", IO.FileMode.Open, IO.FileAccess.Read)
Dim b(fs.Length - 1) As Byte
fs.Read(b, 0, fs.Length)
MsgBox(o.UploadFile(b, "upload.pdf"))
f = Nothing
fs.Close()
Catch ex As Exception
MsgBox(ex.Message)
End Try
End SubYou can use the HTTP classes to write an upload client as a Winexe, there
are examples in the SDK of how to do this using the webclient uploadfile
method, as shown here.

Console.Write("\nPlease enter the URL to post data to : ");
String uriString = Console.ReadLine();

// Create a new WebClient instance.
WebClient myWebClient = new WebClient();

Console.WriteLine("\nPlease enter the fully qualified path of the
file to be uploaded to the URL");
string fileName = Console.ReadLine();

Console.WriteLine("Uploading {0} to {1} ...",fileName,uriString);
// Upload the file to the URL using the HTTP 1.0 POST.
byte[] responseArray =
myWebClient.UploadFile(uriString,"POST",fileName);

// Decode and display the response.
Console.WriteLine("\nResponse Received.The contents of the file
uploaded are: \n{0}",Encoding.ASCII.GetString(responseArray));

You then need to control your server side timouts, and set your
machine.config settings to control the ma file size permitted for uplaods
(look it up - cant recall all the settings)

If you want to resort to FTP, then you can easily script the FTP.EXE that
comes with windows with the /s flag.

--
Regards

John Timney (Microsoft ASP.NET MVP)
--------------
<shameless_author_plug>
Professional .NET for Java Developers with C#
ISBN:1-861007-91-4
Professional Windows Forms
ISBN: 1861005547
Professional JSP 2nd Edition
ISBN: 1861004958
Professional JSP
ISBN: 1861003625
Beginning JSP Web Development
ISBN: 1861002092
</shameless_author_plug>
--------------

"Greg" <greg_leflar@.hotmail.com> wrote in message
news:1651b2f9.0308171354.6c1ee8ae@.posting.google.c om...
> I have seen many posts for this same subject, but my project has some
> odd requirements. I need to develop an ASP app that will upload a
> large file (200 MB+) to a server without any user interaction, meaning
> I can's simply put a file input box on the page and let the user
> choose the file. I basically need them to click a button and have the
> file transferred. I know that this would be a dangerous practice if
> anyone could do it, but is it possible in a controlled environment?
> Because of the size of the file I have been looking at FTPing it, but
> can't figure out how to get client script to start the FTP. I have
> also found this code (below) that utilizes a web service, but I don't
> see how the client-script would get the file from the client since it
> appears to be ASP. Any ideas for this situation would be MUCH
> appreciated.
> <WebMethod()> PublicFunction UploadFile(ByVal fs()AsByte,ByVal
> FlNameAsString)AsString
> Try
> Dim m As New MemoryStream(fs)
> Dim f As New FileStream("c:\tempUploaded\" & FlName,
> FileMode.Create)
> m.WriteTo(f)
> m.Close()
> f.Close()
> f = Nothing
> m = Nothing
> Return "File Uploaded"
> Catch ex As Exception
> Return ex.Message
> End Try
> End Function
> The UploadFile Webmethod accepts a byte array and the name of the
> file, the byte array is copied to a memory stream which is written to
> a FileStream.
> The client code to upload a file,
> Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
> System.EventArgs) Handles Button1.Click
> Try
> Dim f As System.IO.File
> Dim fs As System.IO.FileStream
> Dim o As New localhost.Service1()
> 'file to upload
> fs = f.Open("c:\upload.pdf", IO.FileMode.Open, IO.FileAccess.Read)
> Dim b(fs.Length - 1) As Byte
> fs.Read(b, 0, fs.Length)
> MsgBox(o.UploadFile(b, "upload.pdf"))
> f = Nothing
> fs.Close()
> Catch ex As Exception
> MsgBox(ex.Message)
> End Try
> End Sub
Thank you for your reply. Your code sample makes sense. How would I
then execute that script on the client from an aspx? Again, I don't
know if this is even possible because of the devious implications, but
the client is on our LAN so I have complete control.

"John Timney \(Microsoft MVP\)" <timneyj@.despammed.com> wrote in message news:<OT1XywQZDHA.2668@.TK2MSFTNGP09.phx.gbl>...
> You can use the HTTP classes to write an upload client as a Winexe, there
> are examples in the SDK of how to do this using the webclient uploadfile
> method, as shown here.
> Console.Write("\nPlease enter the URL to post data to : ");
> String uriString = Console.ReadLine();
> // Create a new WebClient instance.
> WebClient myWebClient = new WebClient();
> Console.WriteLine("\nPlease enter the fully qualified path of the
> file to be uploaded to the URL");
> string fileName = Console.ReadLine();
> Console.WriteLine("Uploading {0} to {1} ...",fileName,uriString);
> // Upload the file to the URL using the HTTP 1.0 POST.
> byte[] responseArray =
> myWebClient.UploadFile(uriString,"POST",fileName);
> // Decode and display the response.
> Console.WriteLine("\nResponse Received.The contents of the file
> uploaded are: \n{0}",Encoding.ASCII.GetString(responseArray));
> You then need to control your server side timouts, and set your
> machine.config settings to control the ma file size permitted for uplaods
> (look it up - cant recall all the settings)
> If you want to resort to FTP, then you can easily script the FTP.EXE that
> comes with windows with the /s flag.
> --
> Regards
> John Timney (Microsoft ASP.NET MVP)
> --------------
> <shameless_author_plug>
> Professional .NET for Java Developers with C#
> ISBN:1-861007-91-4
> Professional Windows Forms
> ISBN: 1861005547
> Professional JSP 2nd Edition
> ISBN: 1861004958
> Professional JSP
> ISBN: 1861003625
> Beginning JSP Web Development
> ISBN: 1861002092
> </shameless_author_plug>
> --------------
> "Greg" <greg_leflar@.hotmail.com> wrote in message
> news:1651b2f9.0308171354.6c1ee8ae@.posting.google.c om...
> > I have seen many posts for this same subject, but my project has some
> > odd requirements. I need to develop an ASP app that will upload a
> > large file (200 MB+) to a server without any user interaction, meaning
> > I can's simply put a file input box on the page and let the user
> > choose the file. I basically need them to click a button and have the
> > file transferred. I know that this would be a dangerous practice if
> > anyone could do it, but is it possible in a controlled environment?
> > Because of the size of the file I have been looking at FTPing it, but
> > can't figure out how to get client script to start the FTP. I have
> > also found this code (below) that utilizes a web service, but I don't
> > see how the client-script would get the file from the client since it
> > appears to be ASP. Any ideas for this situation would be MUCH
> > appreciated.
> > <WebMethod()> PublicFunction UploadFile(ByVal fs()AsByte,ByVal
> > FlNameAsString)AsString
> > Try
> > Dim m As New MemoryStream(fs)
> > Dim f As New FileStream("c:\tempUploaded\" & FlName,
> > FileMode.Create)
> > m.WriteTo(f)
> > m.Close()
> > f.Close()
> > f = Nothing
> > m = Nothing
> > Return "File Uploaded"
> > Catch ex As Exception
> > Return ex.Message
> > End Try
> > End Function
> > The UploadFile Webmethod accepts a byte array and the name of the
> > file, the byte array is copied to a memory stream which is written to
> > a FileStream.
> > The client code to upload a file,
> > Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
> > System.EventArgs) Handles Button1.Click
> > Try
> > Dim f As System.IO.File
> > Dim fs As System.IO.FileStream
> > Dim o As New localhost.Service1()
> > 'file to upload
> > fs = f.Open("c:\upload.pdf", IO.FileMode.Open, IO.FileAccess.Read)
> > Dim b(fs.Length - 1) As Byte
> > fs.Read(b, 0, fs.Length)
> > MsgBox(o.UploadFile(b, "upload.pdf"))
> > f = Nothing
> > fs.Close()
> > Catch ex As Exception
> > MsgBox(ex.Message)
> > End Try
> > End Sub

Newbie: Where to start

Hi

I have an asp background. I need to start a long term project with access
backend that would be evolved over a period of time. A flexible and easily
extensible infrastructure is highly desirable. Is there a site that I can
use as model of good practices or a template that I can start with?

Thanks

Regardshttp://www.asp.net/Default.aspx?tabindex=0&tabid=1

"John" <john@.nospam.infovis.co.uk> wrote in message
news:OQ8QxxOwDHA.1740@.TK2MSFTNGP09.phx.gbl...
> Hi
> I have an asp background. I need to start a long term project with access
> backend that would be evolved over a period of time. A flexible and easily
> extensible infrastructure is highly desirable. Is there a site that I can
> use as model of good practices or a template that I can start with?
> Thanks
> Regards
Hi

I am using vs.net 2003 to develop in vb.net. I just don't know how to
structure a good asp.net app as it would be my first. I need to know how to
implement modularity in asp.net so things can be extended easily as the app
develops. Also any tips on saving time on development/maintenance by using
things like templates etc.

Thanks

Regards

"TJS" <nospam@.here.com> wrote in message
news:OwAA3PPwDHA.1088@.tk2msftngp13.phx.gbl...
> http://www.asp.net/Default.aspx?tabindex=0&tabid=1
>
> "John" <john@.nospam.infovis.co.uk> wrote in message
> news:OQ8QxxOwDHA.1740@.TK2MSFTNGP09.phx.gbl...
> > Hi
> > I have an asp background. I need to start a long term project with
access
> > backend that would be evolved over a period of time. A flexible and
easily
> > extensible infrastructure is highly desirable. Is there a site that I
can
> > use as model of good practices or a template that I can start with?
> > Thanks
> > Regards
Thats a lot to be requesting advice on given your on about moving to an OO
based approach.

I woudl strongly suggest that you buy a book to assist you.

Try
http://aspalliance.com/cookbook/default.aspx

Or Dino Esposito's Programming Microsoft ASP.NET

--
Regards

John Timney (Microsoft ASP.NET MVP)
--------------
<shameless_author_plug>
Professional .NET for Java Developers with C#
ISBN:1-861007-91-4
Professional Windows Forms
ISBN: 1861005547
Professional JSP 2nd Edition
ISBN: 1861004958
Professional JSP
ISBN: 1861003625
Beginning JSP Web Development
ISBN: 1861002092
</shameless_author_plug>
--------------

"John" <john@.nospam.infovis.co.uk> wrote in message
news:#sSeyZPwDHA.2440@.TK2MSFTNGP12.phx.gbl...
> Hi
> I am using vs.net 2003 to develop in vb.net. I just don't know how to
> structure a good asp.net app as it would be my first. I need to know how
to
> implement modularity in asp.net so things can be extended easily as the
app
> develops. Also any tips on saving time on development/maintenance by using
> things like templates etc.
> Thanks
> Regards
>
> "TJS" <nospam@.here.com> wrote in message
> news:OwAA3PPwDHA.1088@.tk2msftngp13.phx.gbl...
> > http://www.asp.net/Default.aspx?tabindex=0&tabid=1
> > "John" <john@.nospam.infovis.co.uk> wrote in message
> > news:OQ8QxxOwDHA.1740@.TK2MSFTNGP09.phx.gbl...
> > > Hi
> > > > I have an asp background. I need to start a long term project with
> access
> > > backend that would be evolved over a period of time. A flexible and
> easily
> > > extensible infrastructure is highly desirable. Is there a site that I
> can
> > > use as model of good practices or a template that I can start with?
> > > > Thanks
> > > > Regards
> >
Yes, templates can be used with ASP.net

To incorporate modularity build your code in classes.

--
================================
http://www.ASPkey.net/
A Resource Site for Web Developers
*Free OnLine web Tools
*Free development services
================================

"John" <john@.nospam.infovis.co.uk> wrote in message
news:%23sSeyZPwDHA.2440@.TK2MSFTNGP12.phx.gbl...
> Hi
> I am using vs.net 2003 to develop in vb.net. I just don't know how to
> structure a good asp.net app as it would be my first. I need to know how
to
> implement modularity in asp.net so things can be extended easily as the
app
> develops. Also any tips on saving time on development/maintenance by using
> things like templates etc.
> Thanks
> Regards
>
> "TJS" <nospam@.here.com> wrote in message
> news:OwAA3PPwDHA.1088@.tk2msftngp13.phx.gbl...
> > http://www.asp.net/Default.aspx?tabindex=0&tabid=1
> > "John" <john@.nospam.infovis.co.uk> wrote in message
> > news:OQ8QxxOwDHA.1740@.TK2MSFTNGP09.phx.gbl...
> > > Hi
> > > > I have an asp background. I need to start a long term project with
> access
> > > backend that would be evolved over a period of time. A flexible and
> easily
> > > extensible infrastructure is highly desirable. Is there a site that I
> can
> > > use as model of good practices or a template that I can start with?
> > > > Thanks
> > > > Regards
> >

Thursday, March 22, 2012

Newbie-QueryString or Session ?

I am trying to do my very first VS2005 project using VB. Problem is I'm at a disadvantage because I don't know VB but am determined to learn VS. Anyway, this is what I'm trying to accomplish. I am building a web app for student registration. Currently, the parent must complete a multitude of paper forms, many with the same information, at registration. I am developing the web app to include data entry pages that will capture the data to SQL tables, give the parent an opportunity to review their data and edit any errors and submit it. I will then create another "console" page that will be used by staff so they can print a page that contains all the data, for each student that the parent will sign.

Okay so dumb ?...householdid will be used and need to be updated to a few different tables. In other words, here is the household, related to these 3 students, related to these 2 parents, etc. So my thinking is household table=householdid, student table has studentid (INT) and householdid, contact table has personid(INT) and studentid and may or may not have a householdid (student can have contacts that do not live in the house). So do I store session("house")=householid in the global.asx page in the Session section since it maybe used multiple times? And if so, what do I do on the student.aspx page? Do I add a hiddenfield = to that session, which then updates the student table along with the other data on the student form?

Lots more ?? to come I'm sure!

All good questions, and a valid way to do it. I'd tend not to use the global.asx for any of this and instead use a login/logout and retrieve the id from the database for a valid login. I'm not sure your database is the best setup, but I don't know any of the entites or their relationships so I can't judge. Since you're in 2.0 look into Membership/Profiles for a decent method of handling a lot of this as well.

Jeff


Thanks for the reply. I do not want to require parents to login so would I still use Membership/Profiles?? Can you give me some suggestions on database setup that might be more efficient?

If you're not logging in it's hard to verify any identities, let alone use a membership or profile. What's to keep parents from changing/viewing some other kid? As for database, I don't know that your design is inefficient, I don't really know anything about the data at all.

Jeff


MMM, if the form is set to insert mode, how could a parent even search to edit another student? I originally set this up with a form on a page, with several pages and a "next" button on each page with each form submitting/inserting the data to SQL. But would it be better if I used the "Wizard" control? Can I use a Form View or DetailsView and just enable Inserting? Also if the Wizard is better, how do I get it to insert the data into the SQL table?


Well, how are you choosing the record to insert? I'm assuming you're selecting the student by student ID, so somewhere you have to retrieve this id. It can't be universal in the application, at some point a parent has to identify who they are or who their kid is to be able to insert the correct information and relate it to that kid.

I may be missing something here, since I haven't seen the app or the database structure. You can use any method you wish, it really depends more on what you want as a front end than what happens on the back end.

Jeff


Remember, this is my first try at VS so I may not be thinking correctly! But I want the parent to go to a web site, have a series of data entry forms that all they can do is insert. I guess they will need to somehow be given a chance at some point in the Wizard Steps to verify and correct any errors.

The parent will then physically come into the registration center and all of the data will be reviewed and a few more things added by staff only, and staff will then print out a hard copy form for the parent to sign. So the relationship that I envision is this which is how our student information application works so the data structure is similar; parent enters address, DB creates an identity key called householdid in household table. Then they enter the information about each of their students, and each student has an identity key in student table and included in that student table is householdid (so one household, one or multiple students). Then they enter the information about themselves, the parents and/or contacts for those students just entered and each parent/contact has a personid identity in contact table. Now here is where I can't quite figure out what to do...each parent/contact has a relationshiptype and may or maynot share the same householdid (it may just be an emergency contact that doesn't live in the household) but I need to relate all three...household, student and parent/contact.

For staff I was thinking of doing like a grid and detail page. Am I totally going in the wrong direction here?


I think if you step back and grap a pad of paper to do an entity relationship diagram you'll get this sroted out faster. In the database world, entities are things. Such as students, households, classes, contacts, etc. They have relationships, such as one parent can have more than one kid, but each kid can only have one parent. And each kid belongs to a household, but a contact may or may not belong to a household. Attributes of an entity are things like address, name, phone, etc. In the end, entities become database tables, attributes become the fields/columns in a record, and the relationships between them define how they interact. Each entity is a record in a table, so that Johnny, Jimmy and Susie are all records in the students table. Each individual entity has a single record only, making them a unique item. Normally you would give them a unique ID attribute, such as StudentID, ParentID, HouseholdID, ClassID, etc.

If you have entities that relate then you have foreign keys in your database. Entities can have a one to one relationship, a one to many or many to one relationship or a many to many relationship. For example more than one student can have the same parent, a many to one relationship. A student can have many classes and a class can have many students, a many to many relationship. In a many to one relationship, a foreign key is assigned, so that the student table has a parent ID column that links to their parent in the parent table. In a many to many relationship, you use a linking table with two fields, the StudentID and the ClassID for example.

In Query langauges you have joins and other techniques to handle retrieving the data across the tables. For example, a student's name is a field in the student table, a class time is a field in the class table and you have a joining table with ClassID and StudentID fields. The question you want an answer to is:

"Give me all the class times for John"

The query goes something like (Not real query code):

SELECT ClassTime FROM ClassTable WHERE StudentClasses.StudentID = Students.StudentID for John AND StudentClass.ClassID = Classes.ClassID

This looks up the StudentID for John in the Students table and finds every match in the StudentsClasses table, then taks the corresponding ClassID and looks it up in the Classes table and prints out the class time.

So getting a handle on the underlying structure and the relationships goes a long way to deciding how the code will look and work. Whether you display it in a grid, a detail page, a repeater or tattoo it on the forearm of a welder at Bernie's Body Shop is all just a choice in how you want the end result displayed. And those are the easy parts.

Thus concludes Database Design 101... :)

Jeff


Okay, thanks! I think I might have that part more clear now!! I "basically" had the tables structured like that but have made a couple changes.

So that "easy part" you were talking about...I have two version started, one with multiple pages that use form view to insert records and a next button to take them to next page. And also a Wizard Control that I have used a DetailsView to insert. But I still don't understand how to retrieve the householid, for example, from the first page after it inserts the record and pass it to the next page .

Newby/Novice Question: Printing Web Pages...

Hello, I have a question for the group.
My current project uses multiple panels to display the contents of a
web page. The thing is many of these panels are hidden while only one
is visible at a time (much like tabs). I use a set of command buttons
to switch between these panels. What I would like to do is to create a
print function that will create a preview showing all panels in
sequential order which could be used to print a hard copy.
Any suggestions?
TIA...The simple answer is: Use CSS to do the dirty work
You can set up different stylesheets for screen and print (an example
to follow)
BUT:
It all depends on your app
Is all your data easily available upfront? is there a lot of overhead
involved in fecthing data to be displayed on the other "tab"s
Are your clients on a low latency connection to the server?
EXAMPLE:
<STYLE type="text/css">
@.media print { .ScreenOnly { display: none; } }
@.media screen { .PrintOnly { display: none; }
.TabContentHidden { display: none; visibility: hidden; } }
</STYLE>
<DIV class="ScreenOnly" >This content will not be printed</DIV>
<DIV class="PrintOnly" >This content will not be visible on screen, but
<B>will</B> be printed</DIV>
<DIV class="TabContentHidden" >This is an invisible panel (but will
print)</DIV><DIV class="TabContent" >This is the visible panel (both
print and screen)</DIV>
<DIV class="TabContentHidden" >This is an invisible panel (but will
print)</DIV>
The other advantage to this approach is that you can switch "tabs" on
the browser without the server roundtrips (read near-instantaneous)
Hope this helps
-- addup --
Hmmm.
That looks interesting and might work if I had things setup "normally"
but that approch wouldn't work, I think. I am using ASPdotNET (i.e.
postbacks) to make the different panels/DIVs visible or not. If a
panel is not set as visible by the server it doesn't even show up on
the client side.
Private Sub btnPg1_Click(sender as Object, e as EventArgs) Handles
btnPg1.Click
pnlPg1.Visible = True
pnlPg2.Visible = False
pnlPg3.Visible = False
pnlPg4.Visible = False
pnlPg5.Visible = False
End Sub
Is there perhaps more of a dotNET approach?
TIA...
I guess I should lookup more on that CSS stuff.
You will have to change from ASP.Net Visibility to CSS visiblity:
pnlPg1.Visible = true
pnlPg1.Attributes.Add("display", "");
pnlPg2.Visible = true
pnlPg2.Attributes.Add("display", "none");
pnlPg3.Visible = true
pnlPg3.Attributes.Add("display", "none");
pnlPg4.Visible = true
pnlPg4.Attributes.Add("display", "none");
then in your HTML add
<link href="http://links.10026.com/?link=print.css" type="text/css" rel="stylesheet" media="print">
print.css:
--
#pnlPg1 { display:; }
#pnlPg2 { display:; }
#pnlPg3 { display:; }
#pnlPg4 { display:; }
#pnlPg5 { display:; }
When you change the Visible Property in .NET it doesn't ever render the
control to the browser. If you have all the Visible Properties set to true
and use the css style display attribute = "" (blank-visible) or "none"
(invisible). Then every panel is rendered to the browser and you control
the visiblity on the client side using CSS
So the page uses the default CSS from you code on the screen layout, then
when you print using the it uses the printCSS and will make all panels
visible.
Let us know if this works.
what's "normal" anyway.
While *I* wouldn't do it this way, there's nothing wrong with your
approach
For your case
Set up another command button btnPrint
Private Sub btnPrint_Click(sender as Object, e as EventArgs) Handles
btnPrint.Click
pnlPg1.Visible = True
pnlPg2.Visible = True
pnlPg3.Visible = True
pnlPg4.Visible = True
pnlPg5.Visible = True
Page.RegisterStartupScript("PrintScript", "<SCRIPT
language='javascript'>window.print(); history.back();</SCRIPT>")
End Sub
I would probably have to agree. Setting up a print page would definately be
cleaner
JavaScript to the rescue!...again
I remember using a LOT of JavaScript with ASP.Classic
That gave me something to work with.
Thanks.
Ben Dewey wrote:
> I would probably have to agree. Setting up a print page would definately
be
> cleaner

newcomer help

I'm working on a project in ASP.NET with a lot of VB behind it. When itis finished, we would like to be able to sell the product to othercompanies but we do not want all of our code visible for them to modifyor use for their own. Therefore, is there some way I can compile any ofif into a DLL or EXE or something like that? I'm not exactly sure howto do it or what my options are, but it needs to:
- Still be completely functional with database querying
- Fully working with no loss of functionality

Also, if this is possible, will I have to still have the source codewith it? Any help in protecting this for me would be most appreciated.
Thanks,
Andrew

With ASP.NET you don't have to deploy the code on the web server. Only the dlls inside the bin folder is required.


Thank you for your reply... the only problem is, I have absolutely no clue what you are talking about.
I truly am a newcomer with this and I pretty much need to be babied through it.
putting your codebehind files on the server will work - they will be compiled when you request the asp.net page.
If you want to protect your code, then the best thing to do is to compile them (into a DLL)
If you use Visial Studio, when you run your application, VS.NET willmake your codebehind pages into a DLL and place it in the BIN folder atthe root of your application foler.
To move it to a production server, you copy the BIN folder and your ASPX pages and plonk them on the server.
Job done.
If you are hand coding the pages, then you'll need to use the command line and compile them before placing them on the server.
e.g
on the command line you'd do this to compile:
C:\Inetpub\wwwroot\WebApplication>csc.exe /nologo /target:library /out:bin/Webapplication.dll *.cs
have a look at the article
http://www.thecodeproject.com/aspnet/devaspoutvs.asp
hope it helps you out a little.

also visit this thread --> http://forums.asp.net/974687/ShowPost.aspx

Friday, March 16, 2012

Newly added asp.net webforms cannot parse

Hi,
I simply try to add new default webforms to my project and none of them
can load.
Has anybody received an error like this?

Thanks,

Do

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 'nspi1.WebForm3'.

Source Error:

Line 1: <%@dotnet.itags.org. Page Language="vb" AutoEventWireup="false"
Codebehind="WebForm3.aspx.vb" Inherits="nspi1.WebForm3"%>
Line 2: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
Line 3: <html
Source File: c:\hosting\webhost4life\member\userb\nspi1.3\WebFo rm3.aspx
Line: 1

-----------------------
--
Version Information: Microsoft .NET Framework Version:1.1.4322.573; ASP.NET
Version:1.1.4322.573Hi,

Try to rebuild the project and re-load the page in the browser. You might be
having this error as the page class the newly added page inherits from in
its @.Page directive has not been compiled into the code-behind assembly.

--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio
http://x-unity.miik.com.ua/teststudio.aspx
Bring the power of unit testing to VS .NET IDE

"Do" <doduong12141214@.hotmail.com> wrote in message
news:e%23KSrMFmDHA.2676@.TK2MSFTNGP11.phx.gbl...
> Hi,
> I simply try to add new default webforms to my project and none of them
> can load.
> Has anybody received an error like this?
> Thanks,
> Do
> 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 'nspi1.WebForm3'.
> Source Error:
> Line 1: <%@. Page Language="vb" AutoEventWireup="false"
> Codebehind="WebForm3.aspx.vb" Inherits="nspi1.WebForm3"%>
> Line 2: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
> Line 3: <html>
> Source File: c:\hosting\webhost4life\member\userb\nspi1.3\WebFo rm3.aspx
> Line: 1
>
> -----------------------
--
> --
> Version Information: Microsoft .NET Framework Version:1.1.4322.573;
ASP.NET
> Version:1.1.4322.573
Hi,

Try to rebuild the project and re-load the page in the browser. You might be
having this error as the page class the newly added page inherits from in
its @.Page directive has not been compiled into the code-behind assembly.

--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio
http://x-unity.miik.com.ua/teststudio.aspx
Bring the power of unit testing to VS .NET IDE

"Do" <doduong12141214@.hotmail.com> wrote in message
news:e%23KSrMFmDHA.2676@.TK2MSFTNGP11.phx.gbl...
> Hi,
> I simply try to add new default webforms to my project and none of them
> can load.
> Has anybody received an error like this?
> Thanks,
> Do
> 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 'nspi1.WebForm3'.
> Source Error:
> Line 1: <%@. Page Language="vb" AutoEventWireup="false"
> Codebehind="WebForm3.aspx.vb" Inherits="nspi1.WebForm3"%>
> Line 2: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
> Line 3: <html>
> Source File: c:\hosting\webhost4life\member\userb\nspi1.3\WebFo rm3.aspx
> Line: 1
>
> -----------------------
--
> --
> Version Information: Microsoft .NET Framework Version:1.1.4322.573;
ASP.NET
> Version:1.1.4322.573