TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
parul jain
NA
358
77.7k
how to access protected funtion variable into another func.
Jul 5 2016 5:58 AM
how to access protected funtion variable into another func.
ex.:
protected void gvDetails_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName == "Upload")
{
GridViewRow gvrow = (GridViewRow)(((Button)e.CommandSource).NamingContainer);
int rowIndex = gvrow.RowIndex;
string txtFileName = ((TextBox)gvrow.FindControl("txtFileName")).Text;
string txtContentType = ((TextBox)gvrow.FindControl("txtContentType")).Text;
string txtBytes = ((TextBox)gvrow.FindControl("txtBytes")).Text;
FileUpload FU = ((FileUpload)gvrow.FindControl("file1"));
byte[] bytes = null;
string filename = "";
string contentType = "";
if (FU.HasFile)
{
HttpFileCollection hfc = Request.Files;
HttpPostedFile hpf = hfc[0];
filename = Path.GetFileName(hpf.FileName);
contentType = hpf.ContentType;
using (Stream fs = hpf.InputStream)
{
using (BinaryReader br = new BinaryReader(fs))
{
bytes = br.ReadBytes(Convert.ToInt32(fs.Length));
}
}
txtFileName = filename.ToString();
txtContentType = contentType.ToString();
txtBytes = bytes.ToString();
}
}
}
---------------------------------------------------------------------------
here i want to aceess the value of txtFileName, txtContentType and txtBytes...
how should i access and get the values.please give the solution
Reply
Answers (
2
)
Bundling of JS/CSS files placed on remote server
Coupon Code and cash back which are uses in e-commerces