|
sarith.ka wrote: means its displaying like this page'3.aspx but when i click to that link it redirect to page3.aspx
Goto viewsource and check what is the link. You can check in the status bar also when mouse points over the link. Check there it is coming like page'3.aspx
|
|
|
|
|
no its comning like page3.aspx.
the same thing i bind with gridview there it comes like page'3.aspx
what will i do pls help me
thanks for ur response
Sarith...
|
|
|
|
|
Hello All,
How to upload my local text file to remote server
using ftp command.
i got some code, so when i try to
implement that code in my application i am getting error.
Below i gave what code i implement...
****************************************************************
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.IO;
using System.Net;
using System.Timers;
public partial class Default4 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
System.Net.FtpWebRequest clsRequest = (System.Net.FtpWebRequest)System.Net.WebRequest.Create("E:\\xxxx\\xxxx\\xx\\xxx\\Upload\\downloadnav.txt"); //Here serverpath where we have to upload.
clsRequest.Credentials = new System.Net.NetworkCredential("xxxxxx", "xxxxxxxx"); ///username and password
clsRequest.Method = System.Net.WebRequestMethods.Ftp.UploadFile;
byte[] bFile = System.IO.File.ReadAllBytes("F:\\xxxxxxx.txt");
System.IO.Stream clsStream = clsRequest.GetRequestStream();
clsStream.Write(bFile, 0, bFile.Length);
clsStream.Close();
clsStream.Dispose();
}
}
**********************************
I am getting the following error ...
*** Unable to cast object of type 'System.Net.FileWebRequest' to type 'System.Net.FtpWebRequest'.
So kindly suggest me is there a different way to create the request object to accomplish what I need .
Thanks
Vijay
|
|
|
|
|
MSDN have a solution for using asynchronous operations to upload a file to an FTP server http://msdn2.microsoft.com/en-us/library/system.net.ftpwebrequest.aspx[^]
It states that you need a Uri argument attached to your declaration/instantiation for FtpWebRequest object.
<br />
public class AsynchronousFtpUpLoader<br />
{ <br />
public static void Main(string[] args)<br />
{<br />
ManualResetEvent waitObject;<br />
<br />
Uri target = new Uri (args[0]);<br />
string fileName = args[1];<br />
FtpState state = new FtpState();<br />
FtpWebRequest request = (FtpWebRequest)WebRequest.Create(target); << This is the important bit.<br />
request.Method = WebRequestMethods.Ftp.UploadFile;<br />
Hope this helps
=======================================
There are 10 type of people in the world....
those who understand Binary, and those who don't!
=======================================
-- modified at 4:40 Thursday 9th August, 2007
|
|
|
|
|
You can try this way..
public void uploadFileFTP(string CompleteFTPPath, string CompleteLocalPath)
{
FtpWebRequest reqObj = (FtpWebRequest)WebRequest.Create(CompleteFTPPath);
reqObj.Credentials = new NetworkCredential("username", "password");
reqObj.Method = WebRequestMethods.Ftp.UploadFile;
byte []testFile = File.ReadAllBytes(filepath);//d:abc.txt
//upload
Stream streamObj= reqObj.GetRequestStream();
streamObj.Write(testFile,0,testFile.Length);
streamObj.Close();
streamObj.Dispose();
}
SHWETA!!
|
|
|
|
|
Thank you KernowMan and Shweta
Thank you for providing the code snippet.
My code worked fine after changing K:\\xxxx to ftp://xx.com.
Regards,
Vijay
|
|
|
|
|
Hi,
My project is stuck because of a simple issue if possible please help me out and an early reply will be really helpful.
I want to store a Value in the page itself and use it in the page initialization (Page_Init).
This particular value is page specific, it is not fixed and it can vary from user to user.
In my project I use the value after the postback in the initialisation stage.
My requirement is such that i do not want to use session or cookie. I cannot use viewstate since it is available only on Page_Load. Also since it is a variable value i cannot use database.
Please let me know if it is possible, if yes then how.
Please feel free to revert in case of any clarification.
Thanks!
|
|
|
|
|
Are you allowed Hidden variables?
|
|
|
|
|
Yes, i am using a hidden field for storing the value but after the postback that value will not be available to me during page initialisation.
Thanks!
|
|
|
|
|
Anees Mitha wrote: but after the postback that value will not be available to me during page initialisation.
Can't you access this variable some where other than init event ? Have you tried Request.Form[""] ?
|
|
|
|
|
It is not a form submit event, it is a postback event. The value i need is after the postback in the page initialisation stage.
Thanks!
|
|
|
|
|
Anyone please reply, i am really confused as to how to move ahead with this problem.
Thanks!
|
|
|
|
|
Hi everybody
This Sree
I have login page in my web App and Login Control in it.
Here i want to prefill the login control with username and password in next login if that user once has logged in by checking 'Remeber Me Next Time' check box.
i wanna avoid bypassing user to the authorised pages instead of prompting login credentials .
thank u all
sree
cnu
|
|
|
|
|
Hi friends
i need the code in datagrid paging
Page: 1 of 7
like this
regards
saravanan
|
|
|
|
|
hi frnd,
it is easy, make pagging property true and for more info
check it
http://p2p.wrox.com/topic.asp?TOPIC_ID=23623[^]
regards,
koolprasad2003
If the message is useful for U then please Rate This message...
Be a good listener...Because Opprtunity knoughts softly...N-Joy
|
|
|
|
|
|
Hello Everyone,
Can anybody suggest me the way for running the videos
Actually i have to run some videos in my project ............
for it
1.) Should i include it my projects but at that point i need a player to
run these videos.
Or
2.) Should i upload these videos in YouTube,Googel or Yahoo and fetch these
videos at run time as the visitor desire.........
But there is a problem actually whenever i fetch or bring these videos
from YouTube,Google or Yahoo videos run perfectly but the client dont
as the name appear in the video player like YouTube
He wants something like this .........
Can you suggest me how it is done
http://www.gurumaa.com/online-video-discourses.php
Thnx in advance
|
|
|
|
|
i have address class. i have to store this class object in session object until when application is not closed. how to do it?please provide some guidance
|
|
|
|
|
Hi deepali as per i know about session, any thing carry by session remain until the application alive, respective of session time alloted to it.
Hello Forum
Always be in touch to help about the topic ASP.NET
|
|
|
|
|
Session is a dictionary where you can add object based on key/value pair. When you want to add something, you give a key that you should use later to retrieve the object. So, supposing that your class is called Address , you would save it in session like this:
Address myAddress = new Address();
Session["address"] = myAddress;
To retrieve it, you would do this:
Address mySessionAddress = (Address)Session["address"];
I put "address" as an example for a key, but you can use any string. Just be sure to use the same string to put in session and retrieve from session.
Hope this helps
Talal
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning."
--Rich Cook
|
|
|
|
|
deepalititi wrote: i have to store this class object in session object until when application is not closed.
Application is not closed means ? Do you mean browser ? If yes Talal's solutions is the best. Else you need to go with application variables.
|
|
|
|
|
Hi,
I am created a web application such a type that user can upload the image by drag image from window explorer and drop in web page. Obviously drop image should be on one animation control only. user can see dropped thumbnail images over web page. and then by single click user can upload the images.
Means in single line Drag and Drop and Upload.
Note:Image path retriving from listbox.These path generated when user is dropped the image.
Here we have not using any html inputFile control.
So my problem is,I can not uploading images on server from client machine.But it is working fine on Local PC.
Can any one give me solution for this?
Thanks in Advance!!!!
|
|
|
|
|
FileUpload has SaveAs method to save file on server.
But as per ur requirement u have to download image from server and save to server
are every images on server?
If yes try this code
MemoryStream stream = new MemoryStream();<br />
System.Net.WebClient wc = new System.Net.WebClient();<br />
byte[] image;<br />
string path="ImagePath";<br />
image = wc.DownloadData(path);<br />
int indx = path.LastIndexOf("/");<br />
path = path.Substring(indx + 1);<br />
stream.Write(image, 0, image.Length);<br />
Bitmap bmp = new Bitmap(stream);<br />
bmp.Save(Server.MapPath(path));
Hope this will be helpful
Best Regard
pathan
---------------------------------------------------
|
|
|
|
|
tulsulkar wrote: I can not uploading images on server from client machine.But it is working fine on Local PC.
Because in Local PC your ASP.NET account will have Read/Write permissions. But in your client machine, it don't have permissions.
Is your application working on Intranet ? Then you can permit ASP.NET account to access files contained in the specified folder.But if it is working internet, I think that you need to get HTTPPostedFile class object to perform uploading. But getting this from ListBox seems to be impossible.
|
|
|
|
|
Hi,
On the close event of the window, I want to call a button click event which is present on the server side. so in the body tag in the onload() i am calling the button click event as follows:
<body bottomMargin="0" onunload="formclose();">
function formclose()
{
var res
res = confirm("Do you want to draft this mail, attachments will not be saved.")
if(res == false){
window.opener = self;
window.close();
}
if(res == true)
{
alert(res);
document.getElementById('btnsavclose').click();
}
}
But only the confirmation meassage is fired and not the button click event.
plz suggest me a solution.
riz
Riz
|
|
|
|