|
The data binding adds a bit of overhead because it can use many different kinds of data sources. You can improve on this slightly as you can write code specificly for the data source and for the data that it contains.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
catch (Exception ex)
{
throw ex;
}
Please change that portion to:
catch (Exception ex)
{
throw;
}
By doing it your way, you lose the stack trace and it can be harder to debug future problems. And maybe you actually want to do something in that catch other than rethrowing the error? If not, what's the point of catching it in the first place?
I know this doesn't have anything to do with your problem as I don't see anything wrong with your databinding. So unless you're binding a large set of data like Guffa mentioned, this should work fine.
|
|
|
|
|
Using ASP.Net site manageer in VS 2005, membership is integrated into the SQLServer db, not the Express one.
I have the main folder set to allow all users, to allow default.aspx to show.
Then I have subfolders set to deny all users.
Then I have those subfolders allow a role.
On the default.aspx screen I show Loginview indicating your login status.
Project is published to server.
On local machine, rules work. User clicks on link, demands login for page access.
On server rules are ignored, goes right to page.
Any ideas where to look for the problem?
ps. In the site admin tool, I created a user, then checked the db on the server. It is there, so I'm not editing a local db.
"Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit..."
"There is no one who loves pain itself, who seeks after it and wants to have it, simply because it is pain..."
|
|
|
|
|
Let me know how to hide the "__do javascript postback" in the bottom of the browser.
it occurs when the user clicks link button or button control and so on
Gopinath.R
|
|
|
|
|
what do you mean hide it? what in the code or the actual button?
|
|
|
|
|
vingo_mail wrote: how to hide the "__do javascript postback" in the bottom of the browser
Try having a attribute like onMouseOver and have a friendly value for window.status='' . This function appears mostly for controls that postback like LinkButton and ImageButtons.
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson
|
|
|
|
|
When ever i call asp.net button it will do what are the code inside the button. after refresh that page automatically button event call once again run the button event. How can i avoid this problem?
Thanks,
Nagraj.
|
|
|
|
|
if (Page.IsPostBack == true) etc
hope this helps
|
|
|
|
|
CODE HORROR!
if (Page.IsPostBack)
{
//do stuff
}
Please don't evaluate a bool to a bool, it's not needed.
|
|
|
|
|
ChrisKo wrote: CODE HORROR!
Why? There is nothing wrong with if(Page.IsPostBack == true ), this documents the intent of the code more explicitly. You could also make the argue that Page is unnecessary.
only two letters away from being an asset
|
|
|
|
|
You are doing an unnecessary comparison that can be easily avoided. I haven't actually looked at the IL, but the compiler might be smart enough to ignore that comparison. That is not the main reason for avoiding that type of code though.
The main reason is because it's quiet easy to do this by mistake:
if(Page.IsPostBack = true )
And then you've got things happening that you never expected and it's easy to miss this simple istype for hours.
I agree that Page could be omitted, but as you mentioned, it makes the code more explicit in intent. It's possible that someone new to ASP.NET development takes over maintenance on this project and doesn't know that the Page object is available to him.
I guess I shouldn't have said code horror, but it's something that should be avoided.
|
|
|
|
|
I have a textbox with initial text that I use as a hint for the user.
I want to clear this text once the user click inside the textbox to enter his own text.
But, I was surprised that there is no handler to the click or focus events of the textbox. So, where can I call my code
Mohamed Gouda
Egypt
|
|
|
|
|
Not really an ASP.NET question, but
http://msconline.maconstate.edu/Tutorials/JSDHTML/JSDHTML03/jsdhtml03-02.htm[^]
You're wrong, there is indeed a focus event on a textbox. Perhaps the issue is that you're looking at the server side events that are shown to you by intellisense, when you really want javascript client side events ?
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
I tried javascript, but the autocomplete does not provide handlers rather than those of server side.
So, I dealed with ASP.NET message board
Mohamed Gouda
Egypt
|
|
|
|
|
Yeah, like I said, autocomplete only shows server side stuff, you need to look for client side stuff yourself.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
|
Hi all,
I have a webpage which contains a Datagrid object. It's filled by the hits of the search you make in a textbox. When a row in the result datagrid is clicked, a pdf is being viewed inside the browser. Works fine. But... when you click the back button, the result of the search is lost! Instead you see the former search result.
Example:
I use a datagrid with pageindex. I make a search and gets three pages in the result datagrid. Initially I see the first page. I then click on the second page and then click on one of the search result-rows. The pdf is viewed. Then I hit the back button and I return to page 1 instead of 2!?
I've search through the entire internet for a solution... it's really driving me crazy!!
Can anyone help me?
/Martin
|
|
|
|
|
Why not show the PDF in a new window ? Or, when you change pages, put the page number on the URL and read it from there, so that it will restore
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Thanks for your reply!
I really want to view the pdf in the same browser window. Is there no (easy?) way I can preserve the datagrid data (without putting the pagenr in the url)? Why isn't it there when I push the backbutton? Is the page not cached on my local computer? It's really weird, cause it works fine in firefox. To bad everyone is using IE!
Another thing...
I'm using Response.BinaryWrite to view the pdf (byteformat), which seems to overwrite the current browser view. When hitting the backbutton, the browser doesn't "remember" the former view, but throws me back to the page before the page (2 "steps" back) I want to view (hope you understand what I mean). Is there a way for me to create a blank page (within the browser), and then view the pdf on that page? That should allow me to go back to the former view when I push the back button...
/Martin
modified on Thursday, March 13, 2008 5:32 AM
|
|
|
|
|
Hi All;
I want to send sms through my web site but i have no idea about this plz i want help by toturial or links or books which display this problem from scratch to advanced.
i'm using ASP 2.0 and c#
i want to know from where i'll start to develop
Thank's for your attention
Kareem Elhosseny
modified on Thursday, February 28, 2008 4:09 AM
|
|
|
|
|
To send SMS, you need to communicate with a server that's plugged into the mobile phone network. Obviously. There are articles here on CP about doing this, but they have lots of comments about it not working, I think they may work in India only. Really, you need to find a provider, free or otherwise, you can use in your area.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Dear Christian
Thank's in all cases
i want to know from where i'll start ,
how can i establish a connection to mobile phonr network
and how can i find a provider .
Kareem Elhosseny
|
|
|
|
|
google - the provider will provide the way to connect, there's nothing built into .NET except for the base level stuff (like support for web services ) which such a provider will leverage to make you able to connect to their service
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
my dear ;
do u have any toturial taking about that or websites or any links books some things to help me
Kareem Elhosseny
|
|
|
|
|
elhosseny wrote: my dear ;
In English, this is a really creepy way to refer to somebody you don't know. Its the sort of thing you use to refer to your wife/husband!
elhosseny wrote: do u have any toturial taking about that or websites or any links books some things to help me
Have you tried searching google for a SMS provider in your country?
|
|
|
|