|
|
in mvc people generate html this way and bind data also
@using (Html.BeginForm())
{
@Html.LabelFor(m => p.Name, "Name:")
@Html.TextBoxFor(m => p.Name)
<input type="submit" value="Create" />
}
but if i do not want to use html helper extension then how should i code to bind normal html controls and forms with model data. please come with a sample code. thanks
tbhattacharjee
|
|
|
|
|
@using (Html.BeginForm())
{
<label for="Name">Name:</label>
<input id="Name" name="Name" type="text" value="@Model.Name" />
<input type="submit" value="Create" />
}
Just view the page source to see what html the helpers are generating.
|
|
|
|
|
I am looking for Fuzzy Set Class such as fuzzification.cs,Defuzzification.cs,Fuzzy-Inference(Mamdani).cs in C#.net for developing an web_ based expert system. Could somebody help me please?
|
|
|
|
|
I'm using Visual Web Developer 2010 Express with SQL Server 2008, VB code behind. Yesterday I had an issue with Gridview, today it is with Formview.
I'm exporting the contents of Formview to Excel and have a problem with the formatting. One of my Formview cells contains component size data such as 0402, 0603, 0805 and displays correctly in Formview. When that cell exports to Excel it displays as 402, 603 and 805. Another cell contains a list of ECO numbers such as 4203,4204,4205 and exports as 420,342,044,205. The page I'm exporting has two Formviews and Formview2 has similar potential issues. What can I do to correct the export to Excel to show the data the way it appears in Formview? The difference between Gridview and Formview is different enough that the solution for Gridview does not seem to apply to Formview.
Update: I should mention that inside Formview are numerous labels that actually contain the data I need formatted. Is it possible to "format" the output of these labels?
vb code:
<pre lang="vb"> Protected Sub Button6_Click(sender As Object, e As EventArgs) Handles Button6.Click 'Export to Excel
Dim lbl1 As Label = FormView1.FindControl("PART_NUMBERLabel")
Response.ClearContent()
Response.Buffer = True
Response.AddHeader("content-disposition", String.Format("attachment; filename={0}.xls", lbl1.Text))
Response.ContentType = "application/vnd.ms-excel"
Dim stringWriter As New StringWriter()
Dim stringWriter1 As New StringWriter()
Dim htmlTextWriter As New HtmlTextWriter(stringWriter)
Dim htmlTextWriter1 As New HtmlTextWriter(stringWriter1)
FormView1.DataBind()
FormView1.HeaderRow.Style.Add("background-color", "#FFFFFF") 'white; middle blue #3399FF
For index As Integer = 0 To FormView1.HeaderRow.Cells.Count - 1
FormView1.HeaderRow.Cells(index).Style.Add("background-color", "#969696") 'orange, was #d17250
Next
Dim index2 As Integer = 1
FormView1.RenderControl(htmlTextWriter)
Response.Write(stringWriter.ToString())
If FormView2.DataItemCount <> 0 Then
FormView2.DataBind()
FormView2.HeaderRow.Style.Add("background-color", "#FFFFFF") 'white; middle blue #3399FF
For index As Integer = 0 To FormView2.HeaderRow.Cells.Count - 1
FormView2.HeaderRow.Cells(index).Style.Add("background-color", "#969696") 'orange, was #d17250
Next
index2 = 1
FormView2.RenderControl(htmlTextWriter1)
Response.Write(stringWriter1.ToString())
End If
Response.[End]()
End Sub
asp code for Package_Size:
<asp:label id="Package_SizeLabel" runat="server"
="" text="<%# Bind("Package_Size") %>" width="250px">
asp code for ECO data (UserField02):
<asp:label id="UserField02Label" runat="server"
="" text="<%# Bind("UserField02") %>" width="250px">
Thanks!
|
|
|
|
|
After a lot of experimentation I found a solution to this problem. These labels are inside formview arranged inside a table. I don't understand the reason, but by adding a space after each label the export formats correctly. If anyone can explain this to me I would appreciate hearing from you.
Thanks!
old asp:
<td class="style41" style="border: 1px solid #000000">
<asp:Label ID="Package_SizeLabel" runat="server"
Text='<%# Bind("Package_Size") %>' Width="250px" />
new asp:
<asp:Label ID="Package_SizeLabel" runat="server"
Text='<%# Bind("Package_Size") %>' Width="250px" />
</td><td class="style41" style="border: 1px solid #000000">
|
|
|
|
|
How comes mail on my Interface from my gmail / Yahoo account.
OR
How can i access My mails on my Interface.
|
|
|
|
|
What your Interface is?
Skipper: We'll fix it.
Alex: Fix it? How you gonna fix this?
Skipper: Grit, spit and a whole lotta duct tape.
|
|
|
|
|
Go to your mail account and read the help, which explains how to access your messages.
|
|
|
|
|
Hi my friends.
my name is ali and i am c# programmer.
How can i have 3D visualizations in my asp.net application using Like these :
http://www.3dcadbrowser.com/download.aspx?3dmodel=4400
Or
http://ilnumerics.net/examples.php?exid=c9530c0067f68c342ebe6b90ae8ef2de
Or
http://ilnumerics.net/examples.php?exid=c28c8f3e3a64e1935005c8007c3fe7b5
I can not find any Solution for this problem
can any one help me
|
|
|
|
|
Asp.net is a server-side technology, you can't do any client-rendering with it apart from sending basic html. I couldn't see anything of interest at those links, they were just static images. To have 3d models rendered in the browser you'd need to use something client-side like Flash, Silverlight, or use html5 concepts like the canvas.
http://www.canvasdemos.com/type/applications/3d-applications/[^]
|
|
|
|
|
A perfectly reasonable answer. Downvote countered.
|
|
|
|
|
I have this gridview in asp.net where the data shown comes from a stored procedure
my stored procedure has this query:
AS BEGIN
SELECT vw_AppInfo.ID, vw_AppInfo.FIRST_NAME, vw_AppInfo.MIDDLE_NAME, vw_AppInfo.LAST_NAME, vw_AppInfo.EXTN,
vw_AppScore.ADMISSION_SCORE
FROM vw_AppInfo
RIGHT JOIN vw_AppScore ON vw_AppInfo.ID = vw_AppScore.ID
WHERE vw_AppInfo.REMARKS = 'ACCEPTED'
END
and this is my gridview:
<asp:gridview id="gvGrade" runat="server" allowpaging="True" allowsorting="True" autogeneratecolumns="False" cellpadding="4" datasourceid="SqlDataSource1" forecolor="#333333" gridlines="None" pagesize="30" width="900px">
<alternatingrowstyle backcolor="White">
<columns>
<asp:boundfield datafield="ID" headertext="ID" sortexpression="ID" readonly="true">
<asp:boundfield datafield="FIRST_NAME" headertext="FIRST_NAME" sortexpression="FIRST_NAME" readonly="true">
<asp:boundfield datafield="MIDDLE_NAME" headertext="MIDDLE_NAME" sortexpression="MIDDLE_NAME" readonly="true">
<asp:boundfield datafield="LAST_NAME" headertext="LAST_NAME" sortexpression="LAST_NAME" readonly="true">
<asp:boundfield datafield="EXTN" headertext="EXTN" sortexpression="EXTN" readonly="true">
<asp:boundfield datafield="ADMISSION_SCORE" headertext="SCORE" sortexpression="ADMISSION_SCORE">
<editrowstyle backcolor="#7C6F57">
<footerstyle backcolor="#1C5E55" font-bold="True" forecolor="White">
<headerstyle backcolor="#1C5E55" font-bold="True" forecolor="White">
<pagerstyle backcolor="#666666" forecolor="White" horizontalalign="Center">
<rowstyle backcolor="#E3EAEB">
<selectedrowstyle backcolor="#C5BBAF" font-bold="True" forecolor="#333333">
<sortedascendingcellstyle backcolor="#F8FAFA">
<sortedascendingheaderstyle backcolor="#246B61">
<sorteddescendingcellstyle backcolor="#D4DFE1">
<sorteddescendingheaderstyle backcolor="#15524A">
what I need is that only the Admission_Score/Score column can be edited. I tried using the commandfield but the "update" does not work.
|
|
|
|
|
|
I am using Report Viewer control to display reports in my ASP.NET application. And I am using Server Report from the reporting server services. The reports are displaying fine as expected. But the problem is some reports have active links in them which when clicked redirects to another report. But the reporting server services can be accessed inside the firewall only. But my asp.net application can be accessed from any where. SO my question is how to handle those links i.e how can I display the redirection reports even in the Report Viewer control. Is there any way to manipulate the links programatically, so that they will be displayed on the report viewer.
Hai,
sorry for such a worst framing of my question. I will try now to elaborate it.
1. I have a reporting server installed in my private network. So I can access the reports on the reporting service only inside my private network.
2. Now I am designing a web APP which needs to display some of the existing reports which are already deployed on the reporting services.
3. For That I am using ReportViewer Control in ASP.Net webforms. And I am using Server Report mode which actually uses the the reports already deployed on the reporting server.
4. But the problem is some of my reports have links in it. When we click those links it will redirect to another report that was deployed on the reporting server. So even when I use reportviewer control to view the existing report , the link actaully redirects me to use reporting service URL.
5. As we are using the WEB APP outside the private network, the link actually cant be accessed because the reporting server is accessible only inside the network.
6. Now My question is how can I actually handle those links in such a way that when user clicks on them, they needs to be displayed on yet another reportviewer control rather than redirecting to the reporting server URL. IS there anyway I can manipulate the URL using Code.
|
|
|
|
|
Does my question make sense to anybody. If not please let me know I will elaborate it. Any body please answer it, I have googled so much, but did not find any solution for this.
|
|
|
|
|
You need to be patient, people answer questions in their own time. Many of the members here have full time jobs already.
|
|
|
|
|
Kandepu Rajesh wrote: The reports are displaying fine as expected. But the problem is some reports have active links in them which when clicked redirects to another report.
Kandepu Rajesh wrote: But the reporting server services can be accessed inside the firewall only.
Kandepu Rajesh wrote: But my asp.net application can be accessed from any where
Question:
Kandepu Rajesh wrote: how can I display the redirection reports even in the Report Viewer control. Is there any way to manipulate the links programatically, so that they will be displayed on the report viewer.
[EDIT]
Your either change the link on the server side before the HTML is rendered
Or change the link on the client side in the DOM, using JQuery or just plain Javascript.
If you just want to change the server name, that's pretty easy.
So your saying that not all the reports are report viewer?,
Or you want to swap out the current report for the other report on the same page without a post back when the link is clicked?
You didn't post code showing how the link is generated, or a sample link of now and what you really want it to be. So I can't really offer a precise solution.
You should probably rethink your question, with the pinpointed problem your facing, and not a general overview of the program.
I really wanted to just hit the cancel button on this question, but I tried to help out.
I'm going to take a hit on this with vote downs, and probably delete my post here.
|
|
|
|
|
Hai,
sorry for such a worst framing of my question. I will try now to elaborate it.
1. I have a reporting server installed in my private network. So I can access the reports on the reporting service only inside my private network.
2. Now I am designing a web APP which needs to display some of the existing reports which are already deployed on the reporting services.
3. For That I am using ReportViewer Control in ASP.Net webforms. And I am using Server Report mode which actually uses the the reports already deployed on the reporting server.
4. But the problem is some of my reports have links in it. When we click those links it will redirect to another report that was deployed on the reporting server. So even when I use reportviewer control to view the existing report , the link actaully redirects me to use reporting service URL.
5. As we are using the WEB APP outside the private network, the link actually cant be accessed because the reporting server is accessible only inside the network.
6. Now My question is how can I actually handle those links in such a way that when user clicks on them, they needs to be displayed on yet another reportviewer control rather than redirecting to the reporting server URL. IS there anyway I can manipulate the URL using Code.
|
|
|
|
|
What kind of report server is it? This one
https://msdn.microsoft.com/en-us/library/ms157231.aspx[^]
I think that was poor planning on whoever created the report server and the reports in them.
Guess your just calling a report from the report server, and the report server generates the links in the report.
I would have to see the HTML in the browser, to inspect the format, and then decide what to do.
You could write a JQuery script to load when the dom is ready, and find all the A elements, and loop and inspect to finds the ones you want to change, and change the href attribute value.
If the web server and report server are on the same network, and the reports work, but the access links are different to the public, you should be able to change the links in the report server so all can access it, and the reports generate a new link.
You still didn't give samples of the links, you could just fix the DNS record for it.
But why is this your problem? Your a programer that write code, makes web sites. Unless your the one that made the report server and all the reports.
Maybe this will help
http://stackoverflow.com/questions/12607920/how-to-open-ssrs-report-from-asp-web-page-using-report-viewer[^]
|
|
|
|
|
Hello Experts,
I am generating a function that Exports to Excel using Interop.dll in Vb.net. So Do you think that I need to install office for this on Server machine if I deploy the application? Are there any other things that does export to excel and which will not require Office to be installed on the server machine?
Your help is much appreciated.
Thanks
Happy Coding!
|
|
|
|
|
"Interop" dlls are just .net wrappers around COM objects that allow your .net code to use the underlying COM objects. For the code to function after being deployed, the COM object the interop is a wrapper for needs to exist, so in your case those objects are provided by Excel, so Excel needs to be installed on the server.
Legal and license issues aside, you're not going to get this working reliable (if at all) and it isn't supported by Microsoft. Look to another way of generating excel files like Open XML, Adpose, the excel odbc driver, DocX etc.
|
|
|
|
|
Microsoft does not currently recommend, and does not support, Automation of Microsoft Office applications from any unattended, non-interactive client application or component (including ASP, ASP.NET, DCOM, and NT Services), because Office may exhibit unstable behavior and/or deadlock when Office is run in this environment.
There are various ways to create Excel spreadsheets on the server without using Office interop. For example:
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Thanks Richard
Your help is much appreciated.
Thanks
Happy Coding!
|
|
|
|
|
Yes, so don't use interop.
|
|
|
|