473,698 Members | 2,833 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ok, 2 issues

Ok, I have my first full blown .NET 05 web application 99.9% complete except
for these 2 issues. can anyone help me out?

1) If a page gets and error and the user clicks on the menu it takes them
back to the login screen. How can I prevent that from happening? If they see
the 'user friendly" error page I want them to be able to click another menu
option and go to that page without going back to the login screen. (I'm not
using the membership provider for this app)

2) on several of my pages I have several drop downs and a button. When the
user makes a selection from a drop down and clicks the button, it loads the
..NET gridView. Now I need these grids sortable. How can I accomplish this?
a) I'm NOT using an SQLObjectDataSo urce to bind my grid
b) if I load my grid without any drop downs I can sort, its the
grids that load
based off of a drop down selection

example:
void GetSales(string lastName)
{
binds grid based off of the last name
can't sort grid when using this
}

BUT if i do
void GetSales()
{
binds grids and I can sort the gridview
}

need help on these. thanks

Sep 18 '06 #1
7 1506
1. Have the page as an ASPX page instead of HTML and part of the
application. You might want to set up your own error handler in the Error
event in Global.asax that points to the ASPX error page.

2. Set up a routine that returns the dataSet to bind to teh grid. Have this
routine take the column to sort on, very similar to the samples that ship
with the SDK. Rebind after every sort click. If you do not reset your panels
(form and grid) on each click, viewstate will hold their state.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

*************** *************** *************** ****
Think outside of the box!
*************** *************** *************** ****
"igotyourdotnet " <ig************ @nospam.nospamw rote in message
news:43******** *************** ***********@mic rosoft.com...
Ok, I have my first full blown .NET 05 web application 99.9% complete
except
for these 2 issues. can anyone help me out?

1) If a page gets and error and the user clicks on the menu it takes them
back to the login screen. How can I prevent that from happening? If they
see
the 'user friendly" error page I want them to be able to click another
menu
option and go to that page without going back to the login screen. (I'm
not
using the membership provider for this app)

2) on several of my pages I have several drop downs and a button. When the
user makes a selection from a drop down and clicks the button, it loads
the
.NET gridView. Now I need these grids sortable. How can I accomplish this?
a) I'm NOT using an SQLObjectDataSo urce to bind my grid
b) if I load my grid without any drop downs I can sort, its the
grids that load
based off of a drop down selection

example:
void GetSales(string lastName)
{
binds grid based off of the last name
can't sort grid when using this
}

BUT if i do
void GetSales()
{
binds grids and I can sort the gridview
}

need help on these. thanks

Sep 18 '06 #2
Hello igotyourdotnet,

As for your first question, I've also found your another thread "error
trapping" in this newsgroup and some other members and our engineer Walter
have also joined in that thread. Normally, redirect to login page is caused
by the current user's associated role doesn't meet the ASP.NET(forms
authenticatino) 's authorization requirement. Is the menuitem(on the error
page) point to a page which require higher authorization permission? You
can try Gregory's suggestion on use a static html page to verify the
behavior.

As for the second question, I think basically, we can consider the
following options in ASP.NET 2.0 databinding page:

** If you do not use DataSource control to bind data to GridView, we need
to manually bind DataSource object to GridView.DataSo urce property
programmtically . Also, we should handle GridView.Sort event and rebind the
GridView with the sorted datasource collection. This is just like what we
do in ASP.NET 1.1 for DataGrid.

As for the Sorted DataSource object, I suggest you consider caching a
DataTable of the original data in ASP.NET cache, and when the Gridview's
Sort event fires, you retrieve the DataTable from cache and get a Sorted
DataView from the DataTable. This can help reduce the time we query the
backend database.

#GridView.Sorti ng Event
http://msdn2.microsoft.com/en-us/lib...trols.gridview.
sorting.aspx

Please let me know how you get the datasource object and what's the
datasource object collection so that we can provide some further info
according to the scenario.

** Since you mentioned that you use several dropdownlists to filter the
data retrieved from database and bind them to GridView, how do those
dropdownlist's filter items work in the select query? When using
Datasource Control(SqlData Source or ObjectDataSourc e) we can also configure
the DataSource control to receive paramters from other controls(like
dropdownlist, textbox .....). Therefore, if it is possible to change your
page to use those dropdownlist as paramter source of Datasource control, we
can still bind GridView to datasource control and avoid manual sorting.

Please feel free to let me know if you have any particular concerns or
difficulties here.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

=============== =============== =============== =====

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.

=============== =============== =============== =====

This posting is provided "AS IS" with no warranties, and confers no rights.

Sep 19 '06 #3
1 - all of my pages are aspx pages I have not HTML/HTM pages in my project at
all.

2 - I'm doing that but the grid does not sort, when I click on a row to sort
on the grid dissappears.

"Cowboy (Gregory A. Beamer)" wrote:
1. Have the page as an ASPX page instead of HTML and part of the
application. You might want to set up your own error handler in the Error
event in Global.asax that points to the ASPX error page.

2. Set up a routine that returns the dataSet to bind to teh grid. Have this
routine take the column to sort on, very similar to the samples that ship
with the SDK. Rebind after every sort click. If you do not reset your panels
(form and grid) on each click, viewstate will hold their state.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

*************** *************** *************** ****
Think outside of the box!
*************** *************** *************** ****
"igotyourdotnet " <ig************ @nospam.nospamw rote in message
news:43******** *************** ***********@mic rosoft.com...
Ok, I have my first full blown .NET 05 web application 99.9% complete
except
for these 2 issues. can anyone help me out?

1) If a page gets and error and the user clicks on the menu it takes them
back to the login screen. How can I prevent that from happening? If they
see
the 'user friendly" error page I want them to be able to click another
menu
option and go to that page without going back to the login screen. (I'm
not
using the membership provider for this app)

2) on several of my pages I have several drop downs and a button. When the
user makes a selection from a drop down and clicks the button, it loads
the
.NET gridView. Now I need these grids sortable. How can I accomplish this?
a) I'm NOT using an SQLObjectDataSo urce to bind my grid
b) if I load my grid without any drop downs I can sort, its the
grids that load
based off of a drop down selection

example:
void GetSales(string lastName)
{
binds grid based off of the last name
can't sort grid when using this
}

BUT if i do
void GetSales()
{
binds grids and I can sort the gridview
}

need help on these. thanks


Sep 19 '06 #4
thanks, that example is using a SQLObjectDataSo urce, where I'm not.
and my method to bind my grid takes parameters to get the data back from the
database

"Steven Cheng[MSFT]" wrote:
Hello igotyourdotnet,

As for your first question, I've also found your another thread "error
trapping" in this newsgroup and some other members and our engineer Walter
have also joined in that thread. Normally, redirect to login page is caused
by the current user's associated role doesn't meet the ASP.NET(forms
authenticatino) 's authorization requirement. Is the menuitem(on the error
page) point to a page which require higher authorization permission? You
can try Gregory's suggestion on use a static html page to verify the
behavior.

As for the second question, I think basically, we can consider the
following options in ASP.NET 2.0 databinding page:

** If you do not use DataSource control to bind data to GridView, we need
to manually bind DataSource object to GridView.DataSo urce property
programmtically . Also, we should handle GridView.Sort event and rebind the
GridView with the sorted datasource collection. This is just like what we
do in ASP.NET 1.1 for DataGrid.

As for the Sorted DataSource object, I suggest you consider caching a
DataTable of the original data in ASP.NET cache, and when the Gridview's
Sort event fires, you retrieve the DataTable from cache and get a Sorted
DataView from the DataTable. This can help reduce the time we query the
backend database.

#GridView.Sorti ng Event
http://msdn2.microsoft.com/en-us/lib...trols.gridview.
sorting.aspx

Please let me know how you get the datasource object and what's the
datasource object collection so that we can provide some further info
according to the scenario.

** Since you mentioned that you use several dropdownlists to filter the
data retrieved from database and bind them to GridView, how do those
dropdownlist's filter items work in the select query? When using
Datasource Control(SqlData Source or ObjectDataSourc e) we can also configure
the DataSource control to receive paramters from other controls(like
dropdownlist, textbox .....). Therefore, if it is possible to change your
page to use those dropdownlist as paramter source of Datasource control, we
can still bind GridView to datasource control and avoid manual sorting.

Please feel free to let me know if you have any particular concerns or
difficulties here.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

=============== =============== =============== =====

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.

=============== =============== =============== =====

This posting is provided "AS IS" with no warranties, and confers no rights.

Sep 19 '06 #5
Thanks for your reply igotyourdotnet,

Yes, the MSDN reference's example is using datasource control. Also, based
on my further research, I found that the GridView's enchanded sorting
functions are naturally designed for using Datasource control. (you can
find that the Sort method and the GridView.SortEx pression and SortDirection
property are useful only when we bind Gridview with a datasource control).

However, we can still do the sorting completely without using DataSource
control(though it would be much more complex). We need to do databinding
in the Sorting event , we also need to manually record the sortexpression
and sortdirection ourself and use them to create the Sorted DataView. I
have attached a sample page which programmtically query Database and return
a DataTable(use TableAdapter/typedDataTable) and then create sorted
DataView to databind the GridView. You can get the attachment through
outlook express. Or if you feel necessary I can email it to you.

The sample page is displaying the Product table's data in Northwind
database based on a CategoryID value which is selected through a
DropDownList.

In addition, since such programmatic approach loose the natural feature of
Gridview sorting, I suggset you consider create a custom DataAccess class
to encapsulate your data query and filtering code logic and use this class
in the ObjectDataSourc e so that you can make use of the GridView's default
sort behavior with objectdatasourc e. You can provide me the detailed info
about your page's data access logic and the helper classes, I can help
create a sample page on this if necessary.

Hope this helps. If there is anything unclear, please feel free to let me
know.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

=============== =============== =============== =====

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.

=============== =============== =============== =====

This posting is provided "AS IS" with no warranties, and confers no rights.
Sep 20 '06 #6
Ok thanks

I'm using my web browser to view the newsgroups, can you email it to me at:
igotyourdotnet at gmail dotcom?

Also from what your describing I'm kind of doing but maybe I'm missing
something in the process.

I have my UI calling my business layer which returns a dataset or datatable
from my datalayer. In the datalayer I'm calling the database via a store
procedure. So when I get my data back its already coming back as I want it
but I just need to allow the user to sort the gridview on the client in case
they want to see the data differently.

"Steven Cheng[MSFT]" wrote:
Thanks for your reply igotyourdotnet,

Yes, the MSDN reference's example is using datasource control. Also, based
on my further research, I found that the GridView's enchanded sorting
functions are naturally designed for using Datasource control. (you can
find that the Sort method and the GridView.SortEx pression and SortDirection
property are useful only when we bind Gridview with a datasource control).

However, we can still do the sorting completely without using DataSource
control(though it would be much more complex). We need to do databinding
in the Sorting event , we also need to manually record the sortexpression
and sortdirection ourself and use them to create the Sorted DataView. I
have attached a sample page which programmtically query Database and return
a DataTable(use TableAdapter/typedDataTable) and then create sorted
DataView to databind the GridView. You can get the attachment through
outlook express. Or if you feel necessary I can email it to you.

The sample page is displaying the Product table's data in Northwind
database based on a CategoryID value which is selected through a
DropDownList.

In addition, since such programmatic approach loose the natural feature of
Gridview sorting, I suggset you consider create a custom DataAccess class
to encapsulate your data query and filtering code logic and use this class
in the ObjectDataSourc e so that you can make use of the GridView's default
sort behavior with objectdatasourc e. You can provide me the detailed info
about your page's data access logic and the helper classes, I can help
create a sample page on this if necessary.

Hope this helps. If there is anything unclear, please feel free to let me
know.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

=============== =============== =============== =====

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.

=============== =============== =============== =====

This posting is provided "AS IS" with no warranties, and confers no rights
Sep 20 '06 #7
Thanks for your reply igotyourdotnet,

Yes, I've send you a mail with the attached test pages. Also, my test pages
just use a TableAdapter/typedDataTable to simulate your business object
which return datatable. And manually bind the sorted DataView(create from
the returned DataTable) to the GridView . Also, I use code to
programmaticall y handle the GridView's Sorting event.

Please feel free to let me know if you have any questions on the test code
or other things.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.
Sep 21 '06 #8

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

Similar topics

2
2077
by: Tom Loredo | last post by:
Hi folks- I'm about to move from a Solaris 8/SPARC environment to a Dell running RedHat 9. Are there any issues I need to be aware of in bringing my Python code over (mostly scientific computation)? In particular, I know earlier versions of RH shipped with an "old" Python installed as "python" and that installation of more recent versions should not overwrite "python" (e.g., install as "python2.3"). Is this still the case in RH9? Any...
28
2792
by: grahamd | last post by:
Who are the appropriate people to report security problems to in respect of a module included with the Python distribution? I don't feel it appropriate to be reporting it on general mailing lists.
5
4679
by: sandy | last post by:
Hi All, I am a newbie to MySQL and Python. At the first place, I would like to know what are the general performance issues (if any) of using MySQL with Python. By performance, I wanted to know how will the speed be, what is the memory overhead involved, etc during database specific operations (retrieval, update, insert, etc) when MySQL is used with Python.
2
2309
by: malcolm | last post by:
Hello, We have a robust (.NET 1.1 c# winforms) client-server application that utilizes many typed DataSets, typed DataTables and typed DataRows. Our application is a series of windows and popup windows where you can edit information and data, nothing out of the ordinary. I estimate we have something like 50 to 100 tables and/or views in our database each of which map to one strongly typed DataTable. Now we have some odd 20 to 30 typed...
1
1670
by: Aliandro | last post by:
Hi Does any one know where I can find information regarding any issues with SQL and IIS being run under windows XP SP2? as I am in the process of programmning in Dot net and neet some way of knowing if there are any issues before I start. So if some one can please inform me of a place that has this information that would be greatly appreciated. Thanks Ali
7
1847
by: David Laub | last post by:
I have stumbled across various Netscape issues, none of which appear to be solvable by tweaking the clientTarget or targetSchema properties. At this point, I'm not even interested in "solving" these problems - I'm more interested in isolating them, .i.e. finding a "complete" list of issues. Here's my list of serious issues found so far. By serious, I mean functionality that fails, as opposed to much less serious (albeit annoying) display...
2
3040
by: G2 | last post by:
Hi We are dealing with significant browser compatibility issues with Netscape 5.x+ browsers and Mac IE. I am sure most web developers have faced similar issues in the past. Can anyone give me their thoughts on how they were able to address these issues ? Are there any best practices published by MS on how to ensure browser compatibility when coding asp.net Thanks for any input.
1
1963
by: GaryDean | last post by:
We have been developing all of our .net applications on 32 bit windows using 32 bit SQL Server. We are being asked to now deploy to servers running 64bit windows and 64bit SQL Server. Are there issues? Differences? Should we switch our dev environment to 64bit. What is the advantage of going with 64 bit servers other than being able to address more memory? Thanks, Gary
3
1653
by: eschneider | last post by:
Just some common issues with WS: Using custom objects: When objects change, seems you are always fixing some issue. Update references, which sometimes does not work. Deployment: Weird errors which take a while to fix because the error stink: Forget to set ASP.NET 2.0="Parser Error Message: Could not load type" '*.Global' is ambiguous: it could come from assembly=I deleted the
0
8611
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9031
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8904
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8876
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6531
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5867
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4372
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4624
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2341
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.