|
Hey guys, I'm trying to create a web-form (or website kind of thing) which returns xml when an url was called. I don't want to return html whatsoever, just as if an xml document url was called. How can I accomplish that?
|
|
|
|
|
Response.ContentType="text/xml"
From memory - not sure if MIME should be application/xml instead.
edit: oh yea, and Response.Write your xml then.
"Throughout human history, we have been dependent on machines to survive. Fate, it seems, is not without a sense of irony. " - Morpheus
|
|
|
|
|
Seems to be working even without the Response.ContentType , but I guess using the content type would be neater.
Thanks!
|
|
|
|
|
Using the correct content type would provide hints to the client app that XML is about to be received. Internet Explorer (and probably most web browsers) are smart enough to distinguish XML even without this hint.
|
|
|
|
|
You're correct. text/xml is the right MIME type.
Kyosa Jamie Nordmeyer - Taekwondo Yi (2nd) Dan
Portland, Oregon, USA
|
|
|
|
|
Firsttime i install VS2005. I complete VB also.
so tell me how can i start programming in visual studio 2005.
Anyone know idea plz give me.
Some links to study as beginner in visual studio 2005.
Thanks in advance.
Trust No One
|
|
|
|
|
|
Hi all,
I have GridView which contains few columns of checkbox.My problem is how do I insert or Update Database on save button click(this button is outside the GridView).Following is the code what I have use but not getting where do U update DB:
<asp:GridView ID="GridView1" runat="server" AllowPaging="True"
AllowSorting="True" AutoGenerateColumns="False" Width="100%" CellPadding="4"
ForeColor="#333333" GridLines="None">
<Columns>
<asp:BoundField DataField="FormID" HeaderText="FormID"
InsertVisible="False" ReadOnly="True" SortExpression="FormID">
<HeaderStyle Width="50px" />
</asp:BoundField>
<asp:BoundField DataField="FormName" HeaderText="Form Name"
SortExpression="Name" >
<HeaderStyle Width="100px" />
</asp:BoundField>
<asp:TemplateField HeaderText="Add" SortExpression="Add">
<ItemTemplate>
<center>
<asp:CheckBox ID="chkAdd" runat="server" Checked='<%# IsActive(Eval("Add")) %>' />
</center>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Modify" SortExpression="Modify">
<ItemTemplate>
<center>
<asp:CheckBox ID="chkModify" runat="server" Checked='<%# IsActive(Eval("Modify")) %>' />
</center>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Delete" SortExpression="Delete">
<ItemTemplate>
<center>
<asp:CheckBox ID="chkDelete" runat="server" Checked='<%# IsActive(Eval("Delete")) %>' />
</center>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="View" SortExpression="View">
<ItemTemplate>
<center>
<asp:CheckBox ID="chkView" runat="server" Checked='<%# IsActive(Eval("View")) %>' />
</center>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Print" SortExpression="Print">
<ItemTemplate>
<center>
<asp:CheckBox ID="chkPrint" runat="server" Checked='<%# IsActive(Eval("Print")) %>' />
</center>
</ItemTemplate>
</asp:TemplateField>
</Columns>
<FooterStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
<RowStyle BackColor="#FFFBD6" ForeColor="#333333" />
<PagerStyle BackColor="#FFCC66" ForeColor="#333333"
HorizontalAlign="Center" />
<SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="Navy" />
<HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
<AlternatingRowStyle BackColor="White" />
</asp:GridView>
Public Shared Function IsActive(ByVal sValue As String) As Boolean
If sValue = "True" Then
Return True
Else
Return False
End If
End Function
Protected Sub btnSave_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSave.Click
Dim index As Integer
Dim sCB1Add As String = String.Empty
Dim sCB2Modify As String = String.Empty
Dim sCB3Delete As String = String.Empty
Dim sCB4View As String = String.Empty
Dim sCB5Print As String = String.Empty
For index = 0 To GridView1.Rows.Count - 1
Dim gvRow As GridViewRow = GridView1.Rows(index)
If CType(gvRow.FindControl("chkAdd"), CheckBox).Checked Then
sCB1Add = "1"
Else
sCB1Add = "0"
End If
If CType(gvRow.FindControl("chkModify"), CheckBox).Checked Then
sCB2Modify = "1"
Else
sCB2Modify = "0"
End If
If CType(gvRow.FindControl("chkDelete"), CheckBox).Checked Then
sCB3Delete = "1"
Else
sCB3Delete = "0"
End If
If CType(gvRow.FindControl("chkView"), CheckBox).Checked Then
sCB4View = "1"
Else
sCB4View = "0"
End If
If CType(gvRow.FindControl("chkPrint"), CheckBox).Checked Then
sCB5Print = "1"
Else
sCB5Print = "0"
End If
Next
End Sub
Please help me as I am new for 2005 Version.
Thanks....
|
|
|
|
|
Hey Man,
Use repective Data Class. If you are using SQL Server Data.SQLClient Namespace... You don't know ADO.NET? You have posted three time with the same question to my knowledge.
|
|
|
|
|
Hi Friends,
For some purpose i need to clear gridview ( remove all row) before i re bind the gridview. But i cant find how to clear it.Please Help.
Thanks in Advance ,
Best Regards,
Prya
|
|
|
|
|
GridView.DataSource = null;
GridView.DataBind();
There may also be other ways.
modified on Tuesday, February 2, 2010 7:03 AM
|
|
|
|
|
Hi Sebastien,
Thanks a lot. Its working.
Regards,
Prya
|
|
|
|
|
Hey Prya,
There is no need to clear the GridView before you bind, because GridView normally does clearing. I think you are using DataSet as DataSource of the GridView which is to be cleared.
|
|
|
|
|
Hi All,
I'm trying to read an excel document via a WebForm without having to save the file to the server disk. I need to read the contents of the excel spread sheet and process it. Can anyone let me know how to read the excel document without saving it to the server machine?
Also is it possible to Use the PostedFile.InputStream to populate an Excel object? If yes, please provide with a sample code.
thanks in advance for any kind of help
Regards
Kais
|
|
|
|
|
You might want to check out the Aspose.Cells[^] product which allows loading the Excel from a stream.
|
|
|
|
|
Hi friends.
I am working in vs.net 2005.
i am getting following problem when i run application.
SERVER APPLICATION UNAVAILABLE.
plz give me right solution
thanks in advance
Pathan
|
|
|
|
|
Are you trying to run this locally?
|
|
|
|
|
|
Hi friends
i have just installed VS.NET.
when i create new website i get following error.
Exception of type 'System.Configuration.ConfigurationErrorException' was thrown.
and i cant run website.
plz help me
thanks in advance
Pathan
|
|
|
|
|
Check for errors in your web.config
If you are reading settings from web.config, place breakpoints around that section.
|
|
|
|
|
i completed my contact form and want to test it online. I got .net enabled site. but i dont know which are the files to upload and is there any specific folder in which files are to b upload?
PLz help.
thanks in advance
Sachin
|
|
|
|
|
Hi there:
What you need to deploy to the remote server are that: aspx pages and dll files...
<< >>
|
|
|
|
|
From where to get .dll files?
|
|
|
|
|
You should find them in your bin folder.
|
|
|
|
|
bin folder path is C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin
and
the dll files are...
1.mscorcfg.dll
2.mscormmc.dll
3.RequiredPermissions.dll
4.TlbRef.dll
is it OK.
|
|
|
|