|
hi there,
I've not tried with this before.
But basically, the page "localstart.asp" will be executed when sending a request to the domain. So if u want to redirect all these requests to the free webserver, just simply modify the page above to redirect these request to the free server.
That's just my thought.
<< >>
|
|
|
|
|
hello everyone.
if i have a html form in the current page and i type in IE's address box
javascript:document.forms[0].action="index2.asp"; then instead of setting the form to post the data to index2.asp it just generates another page just containing "index2.asp" text.
also, if i type javascript:document.forms[0].onsubmit=alert(); it immediately executes alert() showing a messagebox, instead of showing it when i click the submit button.
this has to be done in IE's bar, not in the html page itself.
what am i doing wrong?
|
|
|
|
|
The second one is easy. You set onsubmit to be the return value of the call to alert(), of course it will execute alert() immediately to get the return value to put into onsubmit. If you want onsubmit to contain the code that calls alert, you have to enclose it in quotes.
The first one I haven't figured out yet...
---
b { font-weight: normal; }
|
|
|
|
|
to enclose what in quotes?
please post the full line, so that when i submit the form(not when i press enter, after typing code into the address bar) an empty message box appears.
|
|
|
|
|
Enclose the code in quotes.
document.forms[0].onsubmit="alert();";
---
b { font-weight: normal; }
|
|
|
|
|
that's what i'm trying to tell you. i doesn't work. as soon as i type(or paste) the code in the address bar and hit enter the page changes to a blank page containing only "alert();" without the quotes. right-click -> view source on the page opens notepad containing only "alert();"(without the quotes). have you tried this yourself and it works?
|
|
|
|
|
Oh, now I see.
That is because the code returns a value, that value is used to create a new page. Put void(0); at the end of the code, and it will not create a new page.
The same happens if you have javascript in the href property of a link.
---
b { font-weight: normal; }
|
|
|
|
|
1. setting a string works :
javascript:document.forms[0].action="index2.asp";void(0);
2. setting a function does not work :
javascript:document.forms[0].onsubmit="alert();";void(0);
i've also tried this on a submit button with no luck :
javascript:document.forms[0].elements[5].onclick="alert();";void(0);
in both cases the form submits but no empty alert box is displayed(i've also tried with window.open() instead of alert()).
3. what function should i use while a page is loading so that after the page completely loads, an empty message box would be diplayed. for example:
javascript:document.onPageComplete="alert('Page Loaded');";void(0); //would wait for the page to load and display Page Loaded.
4. what should i use instead of quotes if i try to run a more complex script?
for example:
javascript:document.forms[0].elements[5].onclick="document.forms[0].onsubmit="alert('ok');";void(0);";
i can't use single quotes because these already mark a string. Should I use \' or \" ?
-- modified at 17:46 Saturday 17th September, 2005
|
|
|
|
|
2. You have to assign a function to the event:
.onsubmit = Function("alert();");
3. onload
4. Inside a string surrounded by qoutes, you use \" for a quoute. Inside a string surrounded by apostrophes, you use \' for an apostrophe. Use \\ for \.
Example:
document.forms[0].elements[5].onclick='document.forms[0].onsubmit=\'alert(\\\'ok\\\');\';void(0);';
---
b { font-weight: normal; }
|
|
|
|
|
Guffa wrote:
2. You have to assign a function to the event:
.onsubmit = Function("alert();");
3. onload
----------------------------------------
2. still nothing. after this:
javascript:document.forms[0].onsubmit=Function("alert();");
i typed this :
javascript:alert(document.forms[0].onsubmit);
i got this:
function anonymous {
alert();
}
i clicked the submit button and still the same. submits, but no alert box.
3. i used document.body.onunload to make it easier to display after clicking a link. same as above. nothing.
do these work for you?
-- modified at 19:40 Saturday 17th September, 2005
|
|
|
|
|
You can't call alert without a parameter.
alert(1);
---
b { font-weight: normal; }
|
|
|
|
|
dude, you are one cool dude
millon thanks...dude
|
|
|
|
|
I am using ASP to create my web page plz can anyone help,
I want to be able to copy a document with images and paste to a field on my form
Thanks
cleanwater
-- modified at 6:51 Friday 7th October, 2005
|
|
|
|
|
Hi all,
How can I print a .pdf or .doc file from javascript without having to open it?
Thanks
Tony
|
|
|
|
|
|
How do I set the size of a page depending upon a value in the web.config file.
Clueless
|
|
|
|
|
hi there,
do u mean that the size of the client browser?
if so, u can control the size of browser depending on the value in web.config
generally, to set size for web page, u need to do this in java script
below is just an example:
window.open("Sample.htm",null, "height=200,width=400");
Hope this helps
<< >>
|
|
|
|
|
Thanks for that I've tried the following and it opens another window, but I've one more problem that you may be able to help with how do I get rid of the original window.
<%@ Page language="c#" Codebehind="WebForm1.aspx.cs" AutoEventWireup="false" Inherits="testbrowser.WebForm1" %>
<title>WebForm1
function newWindow(newContent)
{
winContent = window.open(newContent,null,'right=0,top=20,width=350,height=350, scrollbars=yes,resizeable=yes');
}
<asp:label id="Label1" style="Z-INDEX: 101; LEFT: 8px; POSITION: absolute; TOP: 8px" runat="server">Test
|
|
|
|
|
u mean that u change the size of the first window.
if so, I think no way now.
And hopefully this will be supported in the future
<< >>
|
|
|
|
|
i've an excel template on server
1 - i read values from db (dbCol1=cell, dbCol=value)
2 - i open template on server and i write dataset in the template
3 - save the template with another name and open this file inside a pege container.aspx with an IFRAME and the source of this one is the excel file
IFRAME src="fileExcel.xls"
4 - user changes excel file in iframe
question
the button is in the page that contains IFRAME (container.aspx)
my problem is not write (Excel.Application Excel.Worbook etc etc) or read a file (with OLEDB or ADO)... my problem is saving the modified file in IFRAME or read the opened file
how can i save (or read) the changed file excel with an aspx button???
***********************************************************************
**************************************************************
|
|
|
|
|
I have a page created dynamically in ASP that contains a table of data from a SQL database. If I right click and hit 'Export to Excel' Excel opens a page containing a picture of the unauthorized.asp page. (I'm guessing Excel uses the url to open a copy of the page, but since it is in a different session, the user is not logged in.) I have created a button/javascript that opens a second page that requeries the database and posts the data in a table with content type = "application/ms-excel", so it works.
My question is is there a way to take the data in the original table and export it to Excel without incurring the overhead of running the query again?
Thx
Mark Jackson
|
|
|
|
|
hi there,
this article below might give u an idea on this
http://www.codeproject.com/aspnet/DGExdel.asp
<< >>
|
|
|
|
|
Hey Guys,
I’m working on a project for my diploma thesis:
A (kind of) web-spider browses the news of (let’s say for instance) CNN or MSNBC. The main goals are:
Sending Keywords to look for articles
Finding news: Since CNN stores their news in a database and not in browserable HTML files it’s necessary to send key-words to the CNN search engine. (E.g. tsunami, hurricane).
Receiving a Webpage, which contains links to all articles that deal with this topic. (E.g. click on the link, to see how the page looks like. http://search.cnn.com/pages/search.jsp?query=tsunami)
Using a spider to receive every single article that deal with the topic
Extracting the news article from the web pages (removing web site elements like navigation, adds,...)
Removing HTML tags – the result after this should be a plain text that just contains the news.
Browsing every single article for certain words to determine what kind of news it is (weather, technology,...)
I’m not sure which technologies to use. Personally I’m familiar with C#. I thought about using an intelligent agent framework, but those are all in JAVA or C++. Anyway, I’m pretty sure there must be something useful for .NET, I don’t want to create a web-spider or an HTML-tag-removal from the very first line. My other concern is: How in general should I design this tool?
Thank’s for help
Stefan
|
|
|
|
|
Before you start creating spider, do have a look on the sites you are going to spider and find out, if they support spiders. They might deny access to spiders and might allow you to get those contents by some other means.
See if you can use RSS feed.
- ashish
|
|
|
|
|
Hi,
I sure this is a bit of a newbee question/problem but I am currently trying to build a table dynamically. The table is on an inherited page and I am looping through a dataset building the cells into a tablerow then adding this row to the table. I am using c# and setting the table row to null after each loop but its not getting very far.
I am creating the row like this - where the cells (f1-f6 are setup with height an width and some have buttons and images)
hr.Cells.Add(f1);
hr.Cells.Add(f2);
hr.Cells.Add(f3);
hr.Cells.Add(f4);
hr.Cells.Add(f5);
hr.Cells.Add(f6);
I am getting an error on this line -
forumtable.Rows.Add(hr);
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
Source Error:
Line 201: hr.Cells.Add(f6);
Line 202:
Line 203: forumtable.Rows.Add(hr);
Line 204:
Line 205: hr = null;
Any help would be most appreciated
|
|
|
|