|
|
Thanks for the response, but I get the error message
"InCorrect Syntax"
It changes CAST(D1.UNIT_RATE AS DECIMAL(10, 2)) AS Rate,
to: [CAST](D1.UNIT_RATE AS [DECIMAL](10, 2)) AS Rate,
I am working in Visual Web Developer and it seems that not all of the functionality of SQL Server is available.
Gene
|
|
|
|
|
I have a PlaceHolder Object in asp page that is filled with several Controls (of different types). How can I retrieve the Data in this Controls after I reloaded the page.
<br />
<tr><br />
<td><br />
<asp:PlaceHolder ID="PLForCostumColumns" runat="server" EnableViewState="True"></asp:PlaceHolder><br />
</td><br />
</tr><br />
the code behind:
<br />
foreach (AbstractCostumField acf in cols.Cols)<br />
{<br />
Label lbl = new Label();<br />
lbl.Text = caps.readCaption(acf.CaptionId);<br />
this.PLForCostumColumns.Controls.Add(lbl);<br />
this.PLForCostumColumns.Controls.Add(acf.darstellen());<br />
Literal lit = new Literal();<br />
lit.Text = "<br />";<br />
this.PLForCostumColumns.Controls.Add(lit);<br />
}<br />
the abstractcostumfields method "darstellen" delivers a WebControl.
|
|
|
|
|
you need to insert these values before page load, otherwise they will not be part of the viewstate tree, and then you won't ever be able to access them.
If they are just labels, it would make more sense to put a literal in there and fill it with all the text from all the labels you are creating.
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 )
|
|
|
|
|
I was able to successfully create a so-called virtual directory on the c Drive of my remote server, but when I try to call it up via a borwser it doesn't work. Specifically:
The domain is "subdomain.abc.com" which resides on my D drive. I created the VD, "Test" on C Drive. But when I type the url "subsomain.abc.com/Test", I get a 404 error. Anyone have a clue what stupid thing I am doing? Here's the code:
Private Sub CreateVirtualDir(ByVal WebSite As String, ByVal AppName As String, ByVal Path As String)
Dim IISSchema As New System.DirectoryServices.DirectoryEntry("IIS://" & WebSite & "/Schema/AppIsolated")
Dim CanCreate As Boolean = Not IISSchema.Properties("Syntax").Value.ToString.ToUpper() = "BOOLEAN"
IISSchema.Dispose()
If CanCreate Then
Dim PathCreated As Boolean
Try
Dim IISAdmin As New System.DirectoryServices.DirectoryEntry("IIS://" & WebSite & "/W3SVC/1/Root")
'make sure folder exists
If Not System.IO.Directory.Exists(Path) Then
System.IO.Directory.CreateDirectory(Path)
PathCreated = True
End If
'If the virtual directory already exists then delete it
For Each VD As System.DirectoryServices.DirectoryEntry In IISAdmin.Children
If VD.Name = AppName Then
IISAdmin.Invoke("Delete", New String() {VD.SchemaClassName, AppName})
IISAdmin.CommitChanges()
Exit For
End If
Next VD
'Create and setup new virtual directory
Dim VDir As System.DirectoryServices.DirectoryEntry = IISAdmin.Children.Add(AppName, "IIsWebVirtualDir")
VDir.Properties("Path").Item(0) = Path
VDir.Properties("AppFriendlyName").Item(0) = AppName
VDir.Properties("EnableDirBrowsing").Item(0) = True
VDir.Properties("AccessRead").Item(0) = True
VDir.Properties("AccessExecute").Item(0) = True
VDir.Properties("AccessWrite").Item(0) = True
VDir.Properties("AccessScript").Item(0) = True
VDir.Properties("AuthNTLM").Item(0) = True
VDir.Properties("EnableDefaultDoc").Item(0) = True
VDir.Properties("DefaultDoc").Item(0) = "default.htm,default.aspx,default.asp"
VDir.Properties("AspEnableParentPaths").Item(0) = True
VDir.CommitChanges()
'the following are acceptable params
'INPROC = 0
'OUTPROC = 1
'POOLED = 2
VDir.Invoke("AppCreate", 1)
Catch Ex As Exception
If PathCreated Then
System.IO.Directory.Delete(Path)
End If
Throw Ex
End Try
End If
End Sub
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
CreateVirtualDir("localhost", "Test", "c:\Test")
End Sub
PS: If it's the "localhost" that is doing it and that should be replaced with "subdomain.abc.com", understand I tried that but got a cryptic, "System.Runtime.InteropServices.COMException: Access is denied."
Anyone know what I am doing wrong?
|
|
|
|
|
I've two scenarios:
1) Using Javascript to create a expandable/collapsible list, that flickers when the page reloads - e.g. when the edit button on a gridview is clicked.
2) Using panels for links, when the expand button is clicked - it displays one panel, when the collapse button is clicked - it displays the other. But that too, off course does the same - the unwanted flickering.
I'm sure there are ways to prevent.
Would anyone please give some hint?
Thanks.
Ekjon
|
|
|
|
|
What do you mean by "flickers"?
Of course, when a button is clicked in the gridview a postback will be generated. Unless the button is an html inout control.
only two letters away from being an asset
|
|
|
|
|
Hello Mark,
Thanks for your response.
My question is - we want the postback, but can we prevent the flickering, meaning that "look" of reloading of the page?
I have seen pages like that, but don't know how.
Any idea?
Ekjon
|
|
|
|
|
AJAX. Look at the UpdatePanel for starters.
only two letters away from being an asset
|
|
|
|
|
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
|
|
|
|