|
Thanks....Mark
|
|
|
|
|
I wrote some code to restrict the back button after signout of my webapplication..
the code is
Response.Expires = 0
Response.Cache.SetNoStore()
Response.AppendHeader("Pragma", "no-cache")
with this code I'm unable to download the files from my server..
File download code is
Response.Clear()
Response.AddHeader("Content-Disposition", "attachment; filename=" & file.Name)
Response.AddHeader("Content-Length", file.Length.ToString())
Response.ContentType = "text/plain"
Response.WriteFile(file.FullName)
Response.End()
How can I solve it??
|
|
|
|
|
Hello
I write this code in an asp.net app
"
<asp:repeater id="rep1" runat="server">
<headertemplate>
<itemtemplate>
<asp:textbox id="txtUnitsInStock" runat="server">
<asp:button id="btnChangeUnitsInStock" runat="server" text="Edit">
<asp:button id="btnDiscontinued" runat="server" text="Upload">
<footertemplate>
"
but the table with two button and a text box don't appear.
Any help will be gratly appreciate
Assaf
|
|
|
|
|
please upload your code again but this time click the checkbox 'Ignore HTML tags in this message (good for code snippets)'
|
|
|
|
|
Hello
<div>
<br />
<br />
<br />
<br />
<br />
<asp:Repeater ID="rep1" runat="server" >
<HeaderTemplate>
<table cellspacing="0" cellpadding="0" border="2">
</HeaderTemplate>
<ItemTemplate>
<tr>
<td>
<asp:TextBox ID="txtUnitsInStock" runat="server"></asp:TextBox>
</td>
<td>
<u><asp:Button ID="btnChangeUnitsInStock" runat="server" Text="Edit" /></u>
<u><asp:Button ID="btnDiscontinued" runat="server" Text="Upload" /></u>
</td>
</tr>
</ItemTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
</asp:Repeater> </div>
the table with two button and the txtbox don't appear
any help will greatly appreciated
Assaf
|
|
|
|
|
Your data source must be empty then, or you're not calling DataBind after setting a data source.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
The following code i'm using to display the image in a Table's Row from the database inside the DataList but it's not bringing the image even not showing any error
<asp:DataList ID="DataList2" runat="server" CellSpacing="0" CellPadding="0" RepeatColumns="1" RepeatDirection="Horizontal" Width="100%">
<ItemTemplate>
<table id="Table_Banner1" cellpadding="0" cellspacing="0" width="100%" border="1">
<tr style="background-image:url(<%# DataBinder.Eval(Container.DataItem,"Image")%>);height:50px;">
<td>
</td>
<td>
</td>
</tr>
..............
Also if i'm doing something wrong please let me know how to do it
I want to fetch a image from a folder and it's(image) url is stored in the database and want set it as background.....
|
|
|
|
|
Get the rendered html source and find the 'url' rendered to the client. Then verify whether the image is available.
*jaans
|
|
|
|
|
Can you explain it a bit more...............
|
|
|
|
|
basically look at the source code in your browser and see if the image is in it
this way you can see if the image is actually being sent to the browser
|
|
|
|
|
Yes it's bringing the Url path as given below
In Internet Explorer
<tr style="background-image:url(/Images/Friendship.jpg);height:50px;">
and
In Netscape or Mozilla
<tr style="background-image:url(~/Images/Friendship.jpg);height:50px;">
But as i remove ~/ then it works fine now plz let me know how to remove this at run-time............. or any other way to ......
|
|
|
|
|
|
Hi all
iam creating a datatable at run time and iam trying to hide columns before binding this table to a grid view. here is the code iam using:
Dim dtSearch As New DataTable<br />
<br />
dtSearch.Columns.Add("Table")<br />
dtSearch.Columns.Add("Field")<br />
dtSearch.Columns.Add("Operator")<br />
dtSearch.Columns.Add("Standard Table")<br />
dtSearch.Columns.Add("Value")<br />
dtSearch.Columns.Add("And/Or")<br />
dtSearch.Columns.Add("TempFieldName")<br />
dtSearch.Columns.Add("TempDDLValue")<br />
<br />
'Add new row<br />
Dim dataRow As DataRow = dtSearch.NewRow()<br />
<br />
dataRow(0) = radcTable.Text<br />
Dim rowId As Integer = radcField.Value.Substring(0, 1)<br />
Dim dt As DataTable = Reference.GeneralSearch.SelectFieldPropById(rowId)<br />
dataRow(6) = dt.Rows(0).Item("FieldName").ToString<br />
dt.Dispose()<br />
dataRow(1) = radcField.Text<br />
dataRow(2) = IIf(radcOperator.Text = "", "", radcOperator.Text)<br />
dataRow(3) = IIf(radcStandardTable.Text = "Not Specified", "", radcStandardTable.Text)<br />
dataRow(4) = txtValue.Text<br />
dataRow(5) = ddlAndOr.SelectedValue<br />
dataRow(7) = radcStandardTable.Value<br />
<br />
dtSearch.Rows.Add(dataRow)<br />
<br />
'sort datatable<br />
' datatable of non-sorted rows<br />
Dim dsSorted As New DataSet<br />
Dim Sort_Column_Key As String = "Table"<br />
Dim Sort_Direction As String = "ASC"<br />
Dim Sort_Format As String = "{0} {1}"<br />
<br />
dtSearch.DefaultView.Sort = String.Format(Sort_Format, Sort_Column_Key, Sort_Direction)<br />
dsSorted.Tables.Add(dtSearch.DefaultView.ToTable())<br />
<br />
ViewState("dtSearch") = dtSearch<br />
<br />
Dim gv As New GridView<br />
dsSorted.Tables(0).Columns(6).ColumnMapping = MappingType.Hidden<br />
dsSorted.Tables(0).Columns(7).ColumnMapping = MappingType.Hidden<br />
dsSorted.AcceptChanges()<br />
<br />
gv.DataSource = dsSorted<br />
gv.DataBind()<br />
<br />
Panel1.Controls.Add(gv)
|
|
|
|
|
I think that
samerh wrote: dsSorted.Tables(0).Columns(6).ColumnMapping = MappingType.Hidden
is wrong
Why are you using column mapping
Itr would help also if you told us what was actually happening
|
|
|
|
|
I know it is not working or wrong
but how can i hide the desired columns
|
|
|
|
|
DataGrid1.Columns(0).Visible = False
|
|
|
|
|
didnt work i already tried it.
please note that iam creating the datatable and gridview at run time
|
|
|
|
|
if your creating it at runtime make sure the code is in the page_load
make sure that you are def hiding the correct column, i.e. the correct number is in columns[X]
try
MyDS.Tables("Tablename").Columns(0).ColumnMapping = MappingType.Hidden
|
|
|
|
|
Thanks for replying but thats what i wrote in the very first post.
|
|
|
|
|
Your line of code was different in the first post
you need to make sure the column number is correct and that it is run in the correct place
apart from that your on your own
|
|
|
|
|
Dim gv As New GridView
dsSorted.Tables(0).Columns(6).ColumnMapping = MappingType.Hidden
dsSorted.Tables(0).Columns(7).ColumnMapping = MappingType.Hidden
dsSorted.AcceptChanges()
gv.DataSource = dsSorted
gv.DataBind()
that is what i wrote and no i didnt put it on page load cause iam adding several rows to that table at run time
|
|
|
|
|
ValidationExpression="^(([a-zA-Z] |(\\{2}\w+)\$?)(\\(\w[\w].*))+(.jpg|.jpeg)$"
This is the vallidation expression given to when uploading an image file given to the file upload control.But when i tried to upload a jpg file this vallidation message is shown .what is the problem.
|
|
|
|
|
does this happen with different file extensions?
|
|
|
|
|
Sorry for the delay.
What does different extension means.i try to upload an image with .jpg extension.But the vallidation willnot be satisfied with the extension and error sees.how to sort it..
|
|
|
|
|
I want to develope an application in asp.net. We are team of 4 people and want to develope a mid size project using .net 2.0 and ajax ,atlas.
so suggest me some idea.
|
|
|
|