|
-
Jan 14th, 2005, 02:12 PM
#1
Thread Starter
Member
My first ASP.NET project!
Hello All,
I am working on a new project that will be written using ASP.NET. The program will be located on my company's intranet where the user will key in a part number and then click a button to view a PDF document in Adobe Reader. The file name and LAN location of the PDF file associated with the part number is held in a SQL Server database table. A separate table will contain a list of network user ID's for which program access will be granted.
The program will perform the following tasks:
1) Get the user's networkID and then query the database to determine if access will be granted.
2) Once a part number has been entered user clicks a "Get Drawing" button, and the program then gathers PDF file records that match the part number. If there are mulitple sheets (each in separate PDF) to the part number, then the program will list the available sheet and prompt the user to make a sheet selection before trigger the opening of the corresponding PDF file.
3) Once a specific file has been determined, the program will open the PDF in Internet Explorer using Adobe Reader.
Since this is quite new to me I was wondering if anyone could offer some input on how to acheive these tasks. The things that I'm researching are:
1) How do I retrieve the user's network ID rather than the intranet server ID?
2) What is the best method for gathering the data from SQL server? I find MANY examples of data binding and data displaying, but very little info on simply querying and evaluating table fields without displaying and manipulating on the screen by the user.
3) How should the data accessing code portion be configured to prevent the user from see the database connection information?
4) What command will execute the opening of the PDF file once the LAN path and file name are retrieved from the database?
That's it. I think the concept is simple, but the task is a bit daunting for a newbie. Any suggestions, code snippets, links to references would be greatly appreciated.
Many thanks,
John
-
Jan 15th, 2005, 10:51 PM
#2
Re: My first ASP.NET project!
 Originally Posted by Johnboy
1) How do I retrieve the user's network ID rather than the intranet server ID?
What do you mean by networkID? Is this the same thing as the user's login for the domain? If so, then you would need to query LDAP. In one case, I've seen a service written which constantly monitors the network's ActiveDirectory and updates a database table with usernames every half hour.
2) What is the best method for gathering the data from SQL server? I find MANY examples of data binding and data displaying, but very little info on simply querying and evaluating table fields without displaying and manipulating on the screen by the user.
In your case, I see no data being written to the database, so you're safe using a datareader. First, to query a table and see if the user exists and to log him in. Second, to query the table for the part number and find out the location of the PDF.
3) How should the data accessing code portion be configured to prevent the user from see the database connection information?
Since you'll be accessing the data in the codebehind, you don't need to do anything, because the server will only output HTML code. You don't need to worry about this.
4) What command will execute the opening of the PDF file once the LAN path and file name are retrieved from the database?
You could do a simple Response.Redirect to the PDF file so the user also gets the option of saving the file. There are other ways, but you'd have to search for them.
-
Jan 17th, 2005, 10:03 AM
#3
Thread Starter
Member
Re: My first ASP.NET project!
 Originally Posted by mendhak
What do you mean by networkID? Is this the same thing as the user's login for the domain? If so, then you would need to query LDAP. In one case, I've seen a service written which constantly monitors the network's ActiveDirectory and updates a database table with usernames every half hour.
Thanks for your reply, mendhak. I'm referring to the Novell Network user ID that is set up by the network admins here for access to the LAN. I'm trying to use the following statement:
txtUserID.Text = HttpContext.Current.User.Identity.Name()
for testing purposes, but it's only returning "". I'm not sure what steps need to be taken to populate this property. For testing this concept I placed the above statement in the Page_Load subroutine of my WebForm1.aspx code.
In your case, I see no data being written to the database, so you're safe using a datareader. First, to query a table and see if the user exists and to log him in. Second, to query the table for the part number and find out the location of the PDF.
This page will only be accessed through a local network here at work, and in order for the user to have access to the page on the intranet they must already be logged in to the LAN using their network ID (issued by the admin) and their personal password. The users that I wish to grant access to this page are merely a subset of the LAN users. This subset list is stored in a SQL Server table. I wish to evaluate the LAN user ID and query for it in the PDF_Viewers table. If found, then access will be granted; if not found, access will be denied.
Does that make more sense?
-
Jan 17th, 2005, 11:06 AM
#4
Re: My first ASP.NET project!
It makes sense but I have no knowledge of working with Novell networks. Is this a mixed network with Windows and Novell machines? (In other words, how are you running ASP.NET?)
I suppose that if this mixed nature of the network will be a problem, it'd be better to issue a new username and password for the application to them. Eliminate the problem altogether.
Do a few searches for networkID on Novell. I doubt if anyone here has done the same thing.
-
Jan 17th, 2005, 11:51 AM
#5
PowerPoster
Re: My first ASP.NET project!
Ensure your site isn't in annoynomous access mode. If it is, network credentials won't be passed on by IIS to the asp.net worker process. You can open up the IIS manager, go to your virtual directory, then go to the properties of it. Then, you can go to the security section and see.
-
Jan 17th, 2005, 01:56 PM
#6
Thread Starter
Member
Re: My first ASP.NET project!
It's working now. The problem was in indeed with the annoynomous access setting. The ID is now showing up as Domain/User, which I can easily work with. Thanks for the suggestion.
I also now have some database querying working nicely as well. I'm using the ExecuteReader method of the SQLCommand object to populate a SqlDataReader object. I can then easily evaluate field values in the SqlDataReader object.
My next hurdle will be figuring out how to manage the multi-sheet drawings by listing the individual sheets that are available for viewing. It seems that some variation of the old technique of imbedding the ASP within VBScript and HTML would work, but I'm not sure how that concept is implemented in ASP.NET with the codebehind file. Any links/suggestions are appreciated.
-
Jan 28th, 2005, 09:04 AM
#7
Thread Starter
Member
Re: My first ASP.NET project!
I'm nearing completion of this project and I have one more newbie type question to ask. I want to place a footer at the bottom of my webform that states the copyright date and legal jargon. I wish to put it in the html code, but when I do if my radiobuttonlist control (which can vary in length) gets too long and runs over my footer statement. What is the method of positioning the web controls so that they don't overrun the html text? Does it have something to do with the POSITION: Absolute statement for the webcontrols in the html code? Any help would be appreciated.
-
Jan 28th, 2005, 10:22 AM
#8
Frenzied Member
Re: My first ASP.NET project!
That's it exactly. I always set my project to flow. I don't know why MS has default Grid.... Flow is the way webdesign works generally speaking.
Magiaus
If I helped give me some points.
-
Jan 28th, 2005, 02:02 PM
#9
Thread Starter
Member
Re: My first ASP.NET project!
Thanks for your reply! Forgive my ignorance, but how does your code example apply to positioning of controls? Where would those statements be placed in my application?
-
Jan 28th, 2005, 02:03 PM
#10
Frenzied Member
Re: My first ASP.NET project!
If you use flow instead of the grid layout and do away with all that style positioning, it can't overlap. Ever, unless you use styles to position it. Tables provide a much cleaner way to do layout work.
Magiaus
If I helped give me some points.
-
Jan 28th, 2005, 03:24 PM
#11
Frenzied Member
Re: My first ASP.NET project!
Control.Style["z-index"] = "999"
not sure if it z-index or zindex
Magiaus
If I helped give me some points.
-
Jan 29th, 2005, 10:02 AM
#12
Re: My first ASP.NET project!
Place everything in a table. All positioning should be done in tables. There are others here who will tell you to use DIVs instead, but you can conveniently ignore their biased propaganda for the time being. 
With tables anything that overflows in one cell pushes everything else down so you don't have to worry about footers being written over.
And I agree, I don't know why the Grid positioning scheme exists.
-
Jan 29th, 2005, 10:29 AM
#13
Frenzied Member
Re: My first ASP.NET project!
I think it's part of Microsoft's plan to do away with Netscape and other browsers...
Magiaus
If I helped give me some points.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|