mardi 29 avril 2014

Accessing file upload control placed in user control from the parent ASP.Net page


Vote count:

0




I've a file upload control in my asp.net user control. This user control is being used in a asp.net page. I want to access the file path selected through this control in my parent page. I'm aware that for user controls, we need to make public properties in code behind which are then available to parent. I wrote the below code in the code behind of user control to make a public property for file path


public string TCSnippetFilePath { get { return Path.GetFullPath(fuTCSnippet.PostedFile.FileName); } set { Path.GetFullPath(fuTCSnippet.PostedFile.FileName) = value; } }


fuTCSnippet is the ID of File Upload control


This code is giving me below error: The left-hand side of an assignment must be a variable, property or indexer


Any inputs on what needs to be done?



asked 38 secs ago






Aucun commentaire:

Enregistrer un commentaire