Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Not Showing Large Part Of the Page

Reply
Thread Tools

Not Showing Large Part Of the Page

 
 
Ed West
Guest
Posts: n/a
 
      08-23-2004

Hello

What is the proper way in ASP.Net to not show large parts of the page?
For example, if I was showing a record detail page, if the record id
does not exist or they don't have rights to see it, I would just show an
error message and NOT show the rest of the html for the all the fields
in the record. And if possible still be able to use the designer to
place the labels and data, etc. In ASP I would do something like:

<%
if (rs.eof and rs.bof) Then
Response.Write "record id " & rs("id") & " does not exist"
Else NOT HaveRights(rs("id")) Then
Response.Write "YOu do not have rights to see this record."
Else
%>
<table>
<tr><td>First Name:</td><td><%=rs("first_name")%></td></tr>
<tr><td>Last Name:</td><td><%=rs("last_name")%></td></tr>
.. . . .

<% End If
%>

Thanks,

-dan
 
Reply With Quote
 
 
 
 
PL
Guest
Posts: n/a
 
      08-23-2004

Use a placeholder around your controls and set the Visible property to false.

If you want to filter individual records from appearing when you
databind to something you probably have to filter it in the sql.

PL.

"Ed West" <(E-Mail Removed)> wrote in message news:(E-Mail Removed)...
>
> Hello
>
> What is the proper way in ASP.Net to not show large parts of the page? For example, if I was showing a record detail page, if the
> record id does not exist or they don't have rights to see it, I would just show an error message and NOT show the rest of the html
> for the all the fields in the record. And if possible still be able to use the designer to place the labels and data, etc. In
> ASP I would do something like:
>
> <%
> if (rs.eof and rs.bof) Then
> Response.Write "record id " & rs("id") & " does not exist"
> Else NOT HaveRights(rs("id")) Then
> Response.Write "YOu do not have rights to see this record."
> Else
> %>
> <table>
> <tr><td>First Name:</td><td><%=rs("first_name")%></td></tr>
> <tr><td>Last Name:</td><td><%=rs("last_name")%></td></tr>
> . . . .
>
> <% End If
> %>
>
> Thanks,
>
> -dan



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sending htp response 404 not found for a page when anonymous usersgo to it and showing the valid page when a logged in user sees it. Andy B. ASP .Net 0 12-23-2008 03:22 PM
Sh Crypto isakmp sa is showing Active but Tunnel is showing line protocol down. urvin Cisco 0 04-15-2008 08:17 AM
ASP 1.1: DataGrid - Showing/Not Showing Buttons Ray Booysen ASP .Net 2 03-28-2006 02:49 PM
Variable displays at one part while does not in another part in a Jack ASP General 8 05-10-2005 07:26 PM
Post back in a part of a web page not all the page Ahmed Hashem ASP .Net 3 12-01-2003 08:18 PM



Advertisments