|
You surely need to buy a ASP.Net book.
In between, check the value of Session["user"]. If it is not null, allow the download else ask him to get out
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
Response.Clear();
Response.ContentType = "application/octet-stream";
Response.AddHeader("Content-Disposition", "attachment;filename=" + fileName);
System.IO.FileStream sourceFile = new System.IO.FileStream(path, System.IO.FileMode.Open);
long FileSize = sourceFile.Length;
byte[] content = new byte[(int)FileSize];
sourceFile.Read(content, 0, (int)sourceFile.Length);
sourceFile.Close();
Response.BinaryWrite(content);
Response.End();
|
|
|
|
|
Hi guys
Need advise, I created a Gridview with a in it.
I can bind the value inside but however when i need compare if the input type button should be checked. I face the problem.
I can't seem to set the radio button to checked after i compare with some validation ::
foreach (GridViewRow row in GridView1.Rows)
{
if (row.Cells[1].Text == "Brandon Tan")
{
((RadioButton)row.FindControl("gvradio1")).Checked = true
}
}
KaKaShi HaTaKe
|
|
|
|
|
you need to replace your html radio button with asp radio button
<asp:RadioButton ID="gvradio1" runat="server" />
|
|
|
|
|
but in these case the radio button will allow mutiple check but i need to restrict to select one only.
KaKaShi HaTaKe
|
|
|
|
|
Try setting
<input type="Radio" name="gvradio" id="gvradio1" runat=server> ;
|
|
|
|
|
Hai,
I am using Master Pages and content Pages to design my website. Inside the content Page i have Form with textboxes. To validate the text boxes in client side, I am using Jscript. But when controls are placed inside the content page the Id of the controls are changed as follows "txtPwd" to "ctl00_CPH_txtPwd".Due to this i can't able to access the controls in client side. I am inneed of an immediate solution to solve this problem.
Can you help me in solving this issue.Thanks in advance.
|
|
|
|
|
Can you use validation controls, for validations.
|
|
|
|
|
|
Thank you SeMartens for your immediate response,I would be more useful. If you provide a simple sample about how to access the controls in client side.
|
|
|
|
|
How do you attach the validation to the controls? If you have sth like a client-side event attached to the controls you can do sth like this:
ASP-Code
myTextbox.Attributes("onclick", "javascript:validateTextbox('" + myTextbox.ClientID + "')");
and the javascript will look like this:
validateTextbox(clientID) {
var control = document.getElementByID(clientID);
}
|
|
|
|
|
you can either read it this way
document.getElementById("<%=Button1.ClientID%>")
or
set the master page id in page load of master page like this
this.ID = "MyID";
then your control id will be
MyID_contentplaceholderid_controlid
also keep in mind that clientid wont work in js files
|
|
|
|
|
Use
document.getElementById ("<%=TextBox1.ClientId%>").value
|
|
|
|
|
How can I move between asp pages and change the first page?
|
|
|
|
|
This place is like a sheltered workshop.
What the hell do you mean by 'move between'. Do you mean Response.Redirect ? Why are you asking questions when you plainly have not done ANYTHING to learn ASP.NET, assuming that's what you mean when you say ASP. Buy yourself a book.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Christian Graus wrote: This place is like a sheltered workshop.
It is getting worse day by day.
BTW, happy to see you back in action
|
|
|
|
|
I hav Created Custom control using AJAX Calender and Textbox.Class Inherits Webcontrol .I am not able to Call TextChanged Event of Textbox. If any body Knows answer Plz Help.
|
|
|
|
|
What do you mean, you can't 'call' an 'event' ? The answer is that you should read the guide to asking good questions, and consider why it is that you expect us to be able to help based on the lack of information you've provided.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Hi There,
I had generated tree by using XMLData Source.When I try to fire Menu Click event it is not get fired.Whats the problem can anybody please tell me.
Thanks.
|
|
|
|
|
The problem is in your code. Hard to say more, based on what you posted.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Thanks For Reply
This My XML File
////////
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" indent="yes" encoding="utf-8">
<xsl:template match="/Menus">
<menuitems>
<xsl:call-template name="MenuListing">
<xsl:template name="MenuListing">
<xsl:apply-templates select="MENU_TREE_STRUCTURE">
<xsl:template match="MENU_TREE_STRUCTURE">
<menuitem>
<xsl:attribute name="Text">
<xsl:value-of select="MTS_GUID_DESC">
<xsl:attribute name="ToolTip">
<xsl:value-of select="MTS_GUID_DESC">
<xsl:attribute name="NavigateUrl">
<xsl:value-of select="MTS_GUID">
<xsl:if test="count(MENU_TREE_STRUCTURE) > 0">
<xsl:call-template name="MenuListing">
////////////////
I had Written Following Code On Master Pages Page Load Event
///////////////
DataSet ds = new DataSet();
string connStr = "Integrated Security=SSPI;Persist Security Info=False;User ID=pank;Initial Catalog=MARKETING;Data Source=ASP6";
using (SqlConnection conn = new SqlConnection(connStr))
{
string sql = "Select MTS_ID, MTS_GUID_DESC, MTS_GUID, MTS_SUBID from MENU_TREE_STRUCTURE";
SqlDataAdapter da = new SqlDataAdapter(sql, conn);
da.Fill(ds);
da.Dispose();
}
ds.DataSetName = "Menus";
ds.Tables[0].TableName = "MENU_TREE_STRUCTURE";
DataRelation relation = new DataRelation("ParentChild",
ds.Tables["MENU_TREE_STRUCTURE"].Columns["MTS_ID"],
ds.Tables["MENU_TREE_STRUCTURE"].Columns["MTS_SUBID"],
true);
relation.Nested = true;
ds.Relations.Add(relation);
xmlDataSource.Data = ds.GetXml();
if (Request.Params["Sel"] != null)
Page.Controls.Add(new System.Web.UI.LiteralControl("You selected " + Request.Params["Sel"]));
///////////////
This Is My Menu Trees Controls Source Code
///////////////
<asp:menu id="Menu1" runat="server" datasourceid="xmlDataSource" skinid="Menu" orientation="Horizontal" onmenuitemclick="Menu1_MenuItemClick" xmlns:asp="#unknown">
<databindings>
<asp:menuitembinding datamember="MenuItem" navigateurlfield="NavigateUrl" textfield="Text" tooltipfield="ToolTip">
////////////////
Thanks
modified on Friday, January 30, 2009 2:26 AM
|
|
|
|
|
I don't see any click event in this code. I still don't know what you mean, b/c I'd expect to see an event defined, if you think you have one and it's not working.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Thanks For Reply,
By Mistake I sent you my previous code.Now you can see above pasted code.I had updated it.
|
|
|
|
|
Hi There,
If anybody know the answer please help
Thanks
|
|
|
|
|
How to fetch the particular data and store in a variable when that data was clicked?
For example in my repeater i have fields like Id,Name,etc. When i click on the Id field,that particular Id will be stored in a variable so that i can use it for my process? Can anyone give Idea or Code with c#?
|
|
|
|