473,396 Members | 1,724 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Not Showing Large Part Of the Page


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
Nov 18 '05 #1
1 1236
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.

"Ed West" <we**@westville.com> wrote in message news:Ou*************@TK2MSFTNGP12.phx.gbl...

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

Nov 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: perspolis | last post by:
Hi I have a question about using exceptions or showing error messages .I say this by an example first way: if(n<0 and w<0) MessageBox.Show("please enter positive") else if (n=0 or w>0)...
2
by: Tor Inge Rislaa | last post by:
Showing an HTML file in part of a Webform Hi I have a Webform with some buttons on the left side of the form. What I want when clicking one of the buttons is to show an HTML document in a part...
1
by: Amber | last post by:
The DataGrid allows you to make columns visible or invisible on demand - even edit and other special columns. This article will show you how it is done. Some developers have reported problems...
0
by: Chris Gardner | last post by:
I have a datagrid that prints a large number of records from a SQL database. Because it is a large table, when printed the table "bleeds" from one page to the next. Ideally, I would like to have...
2
by: ezmiller | last post by:
Hi, I have some code (which I will paste in below) that writes out some HTML dynamically using the W3C DOM...the last part of the code write out a simple table. MY problem is that the table is...
1
by: Rolf Welskes | last post by:
Hello, I have a large web which has PartA, PartB, PartC and MainPart. MainPart WebPage01 ... WebPage_n PartA .... PartB WebPageB01 ... WebPageB_m PartC ... So I would like to do the...
7
by: tshad | last post by:
I have a page that is showing as: Page.IsValid = False on postback when my submit button is pressed but none of my Validators have fired so there is no error message. How do I find out what...
5
by: John Kotuby | last post by:
Hi all, This is my first time trying to creaet and use a custome Web Control in a Web Site project in ASP.NET 2.0 with VS 2005 and VB. I created the control in a separate Web Control Library...
4
by: =?Utf-8?B?U2VyZ2Vp?= | last post by:
Dear staff Can I get your assistance with \3GB (LARGEADDRESSAWARE) switch in mixed mode process built by VS 2008, please? I have a mixed mode application: C# GUI calling native C++ DLL through...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.