|
Hi all,
I'm trying to develope a printer friendly page, the problem is that the content of the page is the search results of another one, and I'm triying pass this content to the print page without having to perform the searching proccess again, in other words ... how can I pass a huge amount of data between these two pages using Client-Side only. By the way this contant should be in HTML format.
Mohammed Derbashi
Web Developer
|
|
|
|
|
You can hide the values of the page in hidden tags:
and then you can request through client side code the value
function WriteMe()
{
document.write("You searched criteria was " + window.opener.document.test.search.value);
}
You might need to double check the Javascript, but it looks something like this. Otherwise just repost back to the server.
Nick Parker
|
|
|
|
|
Mohammed Derbashi wrote:
I'm trying to develope a printer friendly page
<Paul puts on his Preacher hat>
You should not be trying to develop a seperate page for printing, it is conceptually unsound. First off as you have pointed out it can lead to uneeded server load.
This is how you do it. You create two CSS files, one for the screen media, and the other for the print media. In the print media CSS file you basically use the display:none attribute to hide all the elements on the page you do not want to print. You also specify how you want the elments you want to print to look. In this way you can totally re-style a page for printing (e.g. getting rid of navigation, upping the font size, putting in page-breaks etc.) without two seperate ASP/HTML files. Also it requires no round trip to the server. The browser handles it for you.
To reference your two CSS files you do this:
<link rel="stylesheet" href="res/css/printable.css" type="text/css" media="print" /> for the print stylesheet and <link rel="stylesheet" href="res/css/default.css" type="text/css" media="screen" />
As an added bonus you can specify both media="screen, print" to say the default.css file applies to both media. Then when printing any duplicate classes in the printable.css file will override the default.css classes.
Now lets say you have an input element on your page that you do not want to be printed. You assign it a class like so <input type="text" class="inputelement" id="txtFirstName" /> and then in the printable.css file you create a new class like so input.inputelement{ display:none }
Here is a good article on it.
One great benefit of doing this is that should you make a change to the page it will show in the screen and print versions without you having to modify two seperate ASP files. So maintenance is greatly improved.
If you have any problems, just ask
</Paul puts on his Preacher hat>
|
|
|
|
|
What about cross brwoser support? I've found that display:none doesn't work in Netcrape.
|
|
|
|
|
Mark Nischalke wrote:
What about cross brwoser support? I've found that display:none doesn't work in Netcrape
It works in Netscape 6 and as of yesterday Netscape 4 should no longer be supported.
So talking about cross browser it will work in IE5+, Opera 6+, Netscape 6+ and Mozilla 1+. Works on the Mac in those browsers too.
|
|
|
|
|
do you know of any good sites with information of how to create ASP surveys?
thank you!
|
|
|
|
|
Hi Everybody,
I have a ASP program that displays a combobox with nearly 50000 records. I have used MS-Access database. It takes nearly 4 minutes to 7 minutes to display the page over the net. Binding all the records to the combobox takes this much time. In order to solve this problem, I have used rsfast library of learnasp.com. That also takes very long time. Can any help me to solve this problem?
Thanks in advance.
ramesh subbiah
E-Commerce India,
Coimbatore
|
|
|
|
|
How about encapsulating the generation code in a COM object that contains compiled code(C++ or VB), which is faster than the scripting code.
Mohammed Derbashi
Web Developer
|
|
|
|
|
Mohammed Derbashi wrote:
How about encapsulating the generation code in a COM object that contains compiled code(C++ or VB), which is faster than the scripting code.
There is a design flaw in the application, even if you were to create a COM component in VB or C++ to allow early binding to objects which does increase speed he is still going to see a lot of time degradation in the load process. 50,000 entries into a Select box is way too many, even if the file were to be loaded directly on the LAN. I would deeply suggest refactoring the application and look at ways in which you can isolate or group specific numbers, then post back to the server to get another subcategory of numbers. There is not a lot that you can do to see any dramatic decreases in load time for an application loading 50,000 entries into one page.
HTH
Nick Parker
|
|
|
|
|
Nick Parker wrote:
There is not a lot that you can do to see any dramatic decreases in load time for an application loading 50,000 entries into one page.
Especially in Access. I once worked for a company who was trying to use 1,000,000+ record tables in Access (the whole table, not just a few indexed records), that took HOURS to process.
Paul
|
|
|
|
|
Paul Riley wrote:
Especially in Access. I once worked for a company who was trying to use 1,000,000+ record tables in Access (the whole table, not just a few indexed records), that took HOURS to process.
All I can say is "Oh boy...."
Nick Parker
|
|
|
|
|
Nick Parker wrote:
All I can say is "Oh boy...."
That's not quite what I said when they told me. We have a smiley for that round here somewhere. Hold on, here it is:
Paul
|
|
|
|
|
Paul Riley wrote:
We have a smiley for that round here somewhere.
We need a *!Are You Out Of Your Mind!* emoticon.
Nick Parker
|
|
|
|
|
Hi,
I wrote a subclass of DataGrid in which I can fill the grid the way I want it to happen on each page.
In this grid I also create some dynamic comboboxes and bind a SelectedItemChanged event to it. When this event fires, I want to put different data in the grid.
Now, I've implemented this event by creating a new dataset and dataview and binding that to the Grid. If I step through the code, you can see the right effect. After the DataBind, the numer of items in the grid is exactly the way it should be..
So far, everything is as you would expect. But if I put a breakpoint in the PreRender event and look at the items in the grid, nothing has changed! The content of grid is exactly the way it was BEFORE my BindGrid....
When does this happen, who is doing this, and how do I shut it off?
Structured programming vs. chaotic mind boggling
|
|
|
|
|
Hello,
I've created a class which inherits system.web.ui.page (the default inherits of an aspx page). In this class I can use session object but I can't use request object nor server object .
1. Which class shall I inherits to use this object ?
2. How can I simply add a little code to all my page_load sub. I want to check on each page load if the session is still active and if the current user as enough right to load this page. I thought about writing a new class which will inherits default aspx web page class but as I say in point 1, I can't use request and server object. If you have any solution, it will be very welcome.
Thanx
Sybux
|
|
|
|
|
sybux2000 wrote:
n this class I can use session object but I can't use request object nor server object
Thats odd. Just as a quick thought (I have not tried this) but in your class have you referenced using System.Web at all? Might need to, not sure.
|
|
|
|
|
Sorry but It's not possible to reference the full namespace.
Has some an idea ?
|
|
|
|
|
sybux2000 wrote:
Sorry but It's not possible to reference the full namespace.
Not sure what you mean. Do you mean when you code in that using statement it tells you no such namespace exists? In that case you need to add the DLL to your project as a reference.
Otherwise I am not sure, post some code and then maybe we can help
|
|
|
|
|
Hi,
how can I change programaticaly the bgColor of my page for example ?
Thanx
|
|
|
|
|
Try using HTML Control and CSS like this:
<script language="VB" runat="server">
Private Sub Page_Load(obj as Object, e as EventArgs)
objBody.Style("background-color")="#cccccc"
End Sub
</script>
<html>
<body id="objBody" runat="server">
<h1>Hello World</h1>
</body>
</html>
Enrico
|
|
|
|
|
Apologies if this is an old question.
My website is hosted on a fairly standard NT setup with ASP (not ASP.net - though I think that is supported as well). The question is, I'd like to permission off a particular area of the web site, how do I do it? I don't have any kind of rights on the box.
The only thing I do have control over is an access db file, and listing the contents of directories. I've looked at the help from my hosts and there doesn't seem to be anything in there
Thanks.
B.
|
|
|
|
|
Barry,
I had met similar problem before. In a hosted environment, we have limited control over securing a portion of the website.
ASP.NET has the solution to secure a folder using setting in web.config, but again some hosting servers only allow web.config file to resides in root folder.
What I did in classic ASP and ASP.NET is to provide login/logout facility to authenticate user. The user credentials are stored in the database. Once the user is authenticated, I stored the authentication info in cookies. Then in the beginning of each web page I want to secure, I call a function to check the cookie and find out whether the current user is authenticated.
This is a hard way but worth to try. If you need some sample codes, just drop me an email.
Enrico
|
|
|
|
|
Enrico,
Thanks for that I've already started doing something similar (when I get the time!) It's only to really protect parts of the site from the casual user so it doesn't have to be perfect!
Thanks,
Barry.
B.
|
|
|
|
|
How can I change the position of controls in my code behind file?
Mazy
"If I go crazy then will you still
Call me Superman
If I’m alive and well, will you be
There holding my hand
I’ll keep you by my side with
My superhuman might
Kryptonite"Kryptonite-3 Doors Down
|
|
|
|
|
Mazdak wrote:
How can I change the position of controls in my code behind file?
Do you mean the visual position of the HTML elements on the page?
|
|
|
|