|
hi i been seeing web site which whent he user clicked edit on a perticular item another browser appear wit textbox for user to change the data of the the item they click edit and whent he update button is clicked the main browser would refresh itself
i would like to ask how is this done?
what method izzit using
is this possible with asp.net2?
|
|
|
|
|
Just view html code to see how it is done...
neodeaths wrote: is this possible with asp.net2?
Yes...
<< >>
|
|
|
|
|
in asp.net2 we use redirect to redirect the current page to the desired one
how can i make a new browser pop up?
also what code in my sub browser am i to put to make the main browser refresh?
|
|
|
|
|
neodeaths wrote: how can i make a new browser pop up?
using window.open(...) method to open up new window
neodeaths wrote: what code in my sub browser am i to put to make the main browser refresh?
try this window.opener.location.reload(); ..let me know if it works or not
<< >>
|
|
|
|
|
Error 104 The name 'window' does not exist in the current context
is the error given to me for the window.open()
do i have to import any thing like
using .....
|
|
|
|
|
Nope...those are javascript methods...Do you know how to how to use js function?
<< >>
|
|
|
|
|
rougly by the way can u comfirm if my thinking is correct
asp.net2 code behind files are handled at server means the calculation made in the code behind file are made at server side
where by the java script is made at client side?
|
|
|
|
|
However, in code behind you can generate javascript code to execute at client side...
<< >>
|
|
|
|
|
How do I get javascript such as that listed below to be read in an ASP file before the command <%response.redirect iurl(url)%>
<%id = request("id")
sql = "Select * from listings where id ="&id
open_recordset rs,SQL
hits = rs("hits") + 1
sql ="update listings set hits ="&hits&" where id = "&id
conn.execute(sql)
url = rs("url")
closelink(rs)
closeDB()%>
<%response.redirect iurl(url)%>
At the moment it just redirects to the new page without executing the javascript.
If I remove <%response.redirect iurl(url)%> then the javascript is read, however when I add <%response.redirect iurl(url)%> the javascript is ignored and it just redirects to the new page. Any ideas why this is happening?
|
|
|
|
|
Where do u want to call that java script function?Could u please be little bit clear?
|
|
|
|
|
I want to Develop a Database programe with Asp.net.
i put a datagrid in a page, and press a button to show a dialog page . I can input a new record in the page, and save it, Close it .
Can i refresh the datagrid page automatically? How can i do it ?
thanks
|
|
|
|
|
When you input a new record, and you save it, it must do a postback, so the page will refresh. If you close the page, then you have closed the page, there is nothing to refresh, but if you saved the data, any user can go back to that page and see the new data.
I therefore do not understand your question.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
My Question is :
there are two page:
A : have a datagrid ,a new record button btnNew
B : New Record form a Save button btnSave
when i enter A page , click btnNew to open B page , click btnSave to save the record ,then close page B.
then we can see page A. But i can't see the record i just input. So i want refresh Page A ,when i close the page B .
Thanks .
|
|
|
|
|
Hi,
Can you tell me how do u close the dialog page?
If you are using window.close() method in javascript to close the window then modify the javascript as following.
window.opener.location.reload();
window.close();
the first line will reload the the window from where u have open the dialog page.
I hope this will help you.
Thanks and Regards,
Chetan Ranpariya
|
|
|
|
|
just do like from the child page.
function exitChildWin() {
window.opener.reload();
window.close();
}
just call the exitChildWin javascript function from the child page.
tbhattacharjee
|
|
|
|
|
We are looking for some assistance to get all aspects of our web application working on the web server.
Just to give a brief overview, we have created an application which allows people to sign up to use our general classifieds section. Upon clicking the submit button, the application inserts the record into the appropriate table in our MSSQL database, creates a new sub-folder for the user, using their username, and the creates two more sub-folders (one to store images and one to store PDF files) under the Username's folder.
The registered user can search the classified listings and the results pane shows a small thumbnail and decription. The user can click on the thumbnail to view more details. The problem we are experiencing is the display of the thumbnail and image.
Prior to this we had problems in uploading the image to the server in the following function:
private void SaveImages()
{
if (Session["UserType"].Equals("Customer"))
{
if (FileUpload1.FileName != "")
/* {
ResizeImage(300, 300, FileUpload1.PostedFile.FileName, Server.MapPath("~\\Customer\\" + Session["username"].ToString() + "\\Classifieds_Images\\") + FileUpload1.FileName);
ResizeImage(300, 300, FileUpload1.PostedFile.FileName, Server.MapPath("~\\" + "AllClassifiedsImgs\\") + FileUpload1.FileName);
} */ {
File.Copy(FileUpload1.PostedFile.FileName, Server.MapPath("~\\Customer\\" + Session["username"].ToString() + "\\Classified_Images\\") + FileUpload1.FileName, true);
}
if (FileUpload2.FileName != "")
{
File.Copy(FileUpload2.PostedFile.FileName, Server.MapPath("~\\Customer\\" + Session["username"].ToString() + "\\PDF_Files\\") + FileUpload2.FileName, true);
}
}
else if (Session["UserType"].Equals("Shopper"))
{
if (FileUpload1.FileName != "")
/* {
ResizeImage(300, 300, FileUpload1.PostedFile.FileName, Server.MapPath("~\\PWC_Shoppers\\" + Session["username"].ToString() + "\\Classifieds_Images\\") + FileUpload1.FileName);
ResizeImage(300, 300, FileUpload1.PostedFile.FileName, Server.MapPath("~\\" + "AllClassifiedsImgs\\") + FileUpload1.FileName);
} */ {
File.Copy(FileUpload1.PostedFile.FileName, Server.MapPath("~\\PWC_Shoppers\\" + Session["username"].ToString() + "\\Classifieds_Images\\") + FileUpload1.FileName, true);
}
if (FileUpload2.FileName != "")
{
File.Copy(FileUpload2.PostedFile.FileName, Server.MapPath("~\\PWC_Shoppers\\" + Session["username"].ToString() + "\\PDF_Files\\") + FileUpload2.FileName, true);
}
}
}
We commented out the portion of code which called the Resize function and just opted to use the File.Copy line (hopefully you can follow this above) and got around the image uploading issue.
The problem we have now is that when the results are displayed, the thumbnails and images are displayed as small red x's indicative that the filepath/filename is either invalid or the image is not present.
When the developer tests this same application on his computer, the application works as it should. When I copied the exact same folders/files to my own local computer to see if the fact we have our web applications located on the F drive (not the C drive) was the reason however I get the same problems with the display of the images.
I suspect it is a configuration issue or a setting held in the ASPX/ASPX.CS files where it is looking for files or directories or paths which are present on the development environment but not on the server but this is only a guess.
I am late in getting this application released for general use and as a result losing a lot of credibility rapidly. If anyone can help us to solve this issue, I would be eternally grateful.
Please ask any questions you wish as I may not have explained the problem clearly enough.
Kind regards
Lesley
Lesley
Popweb City
|
|
|
|
|
Have you tried doing a response.write to render the path it's looking for, to see if it's what you expect ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
I am not one of the programming team - just the system architect but did think about this before as maybe being something useful to do.
Are you able to provide me a sample of code I could paste into an aspx page so I could test to see what is being returned?
Cheers and thanks
Lesley
Popweb City
|
|
|
|
|
Wow - my definition of a system architect would not include the word 'just'.
Response.Write("The file path is ~\\Customer\\" + Session["username"].ToString() + "\\Classifieds_Images\\") + FileUpload1.FileName);
Should do it.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hi Christian
this is the response:
The file path is ~\Customer\lesleyag\Classifieds_Images\
How do I find out what the tilde is referencing? I have a gut feeling that this is where the problem may be occuring but would like to find out for sure although in saying this, this line of code does upload files to the correct place:
{
File.Copy(FileUpload1.PostedFile.FileName, Server.MapPath("~\\PWC_Shoppers\\" + Session["username"].ToString() + "\\Classifieds_Images\\") + FileUpload1.FileName, true);
}
so potentially this is correct.
The major issue I am having is that the images are not being displayed on another page. It is this page which works on the development machine but not the web server
Lesley
Popweb City
|
|
|
|
|
What is the URL you're going to ? I suspect the problem is that you have a name in the string on one end, i.e. your devs are using localhost/customer/xxx and the users are using www.mysite.com/subsite/customer/xxx
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Okay, the URL is www.popwebcity.com/in - just for now, login as lesleyag and password is abc - it is only a test case so not a big issue as I will alter the password later on.
If you click on Show Classifieds and then SHOW ALL, you will see the small red crosses where there are images. In the web.config file, we reference the actual IP address not (localhost)
But when I created a website (virtual folder)on my local machine, which does reference http://localhost/in/showclassifieds.aspx the same thing happens in the image display which makes me think there is some other setting I am not seeing.
Lesley
Popweb City
|
|
|
|
|
OK, I think you need 'in' at the top of your path.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
I have just looked through the code which is not displaying the images and after piecing it together, my programmer has created a separate folder for all the images so the original is stored in the user's folder and a copy is stored in another folder called \AllClassifieds which is not a silly thing to do.
In the table, where the Classified Ads are located, he stores the filename and then in the select statement, selects the field called AdImagePath which is effect is the filename and I think he reads this into a data source. In the display page, he uses this bit of code:
" title="Click here to see details">
Should the src be referencing the sub-folder as "src='/AllClassifiedsImgs/<%#Eval("AdImagePath")%>' rather than just "src=AllClassifiedsImgs/......'
because I really cannot see anything else in the code which looks out of place (not that my coding knowledge these days is superb or expert!
Cheers again
Lesley
Lesley
Popweb City
|
|
|
|
|
Yeah, that definately makes a difference.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|