Not Showing Large Part Of the Page

E

Ed West

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
 
P

PL

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top