|
The config turned off everything on me, server error 500.1 or something.
Should of used read, or something.
I just solved my redirect login, the IsLocalUrl, so I'll tackle that tomorrow morning.
You have to login or register to download the file.
[edit]
MVC does let you download the file in you type directly. Interesting. Maybe I should of put it in app_Data, since I'm reading the bytes.
|
|
|
|
|
The config file I posted should prevent you from downloading the file directly. I've used it on lots of sites without any problems.
If you're getting a 500 error when you add it, try accessing the site from the server to see the full details of the error.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
OK, will give that a try today.
|
|
|
|
|
Hi Every Body,
Can any one help!
How to create a new MVC Application using any CMS Template.
Thanks in advance.
|
|
|
|
|
What do you mean by "using any CMS template"?
|
|
|
|
|
In asp.net which cms is provide more security for developing website? customized cms or third party cms like dnn,wordpress,umbraco,etc.. ?.
|
|
|
|
|
What do you mean by "more security"? More security features or what?
|
|
|
|
|
Sir,dnn,wordpress are open source so any one can hack immediately into the project.but customized cms is more secure than third party cms??
|
|
|
|
|
RajeeshMenoth wrote: so any one can hack immediately into the project
Since when does "open source" mean "less secure"? Having access to the source code does not mean you're going to know where all the weaknesses are. There are plenty of other things you have to do to the server that have nothing to do with the application code to properly secure the server.
|
|
|
|
|
I want to add navigation method in my project,but i am not able to add all navigation method Please give me coding of all method.
|
|
|
|
|
Yeah, that's not going to happen. There are simply too many different ways of doing navigation. All you have to go is Google for "ASP.NET navigation" and you'll come up with all kinds of ideas and 3rd party controls to do this.
|
|
|
|
|
Hi... run time i'm getting error as "Uh-oh, something went wrong! Error Code: 500".
In web.config file, i specified custom error mode to "off": <customerrors mode="Off">
Then also i'm getting same error..
any help appreciated...!
Thank you
|
|
|
|
|
That is a custom error, designed by the developer (maybe you) to hide the actual error in the background.
The 500 tells the developer that there has have been some run-time error, such as some error that broke the code and threw this error. Try re-loading the website in your IIS to re-compile and start the website's settings from beginning. Then it would display the error.
(If you're using Visual Studio as your IDE)
Otherwise, a side-note can be to debug the website using Visual Studio. Add a breakpoint to your functions, and Visual Studio would help you in catching the errors.
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~
|
|
|
|
|
Special credit for code below goes to the great Richard Deeming.
Originally, the code was intended to search by date range or specific date.
Currently, a couple of changes have been made to the code per user specs.
Search is now done specifically with date range using jQuery datepicker.
The range could be just one day or multiple days.
Requirement 1: User selects a begin date, let's say 02/22/2015 and end date 02/22/2015(1 day).
The user selection searches Reservations table to see if the date(s) user selected have already been used for prior reservations.
If the date(s) have been taken, present user with on month's worth of results including the taken dates.
If the date(s) have been taken, present one month's worth of results including the taken dates.
How do I modify code below to get it to work?
So far, I run the code and no results are displayed.
Thanks a lot in advance.
Private Sub showGrid()
Dim conn As New SqlConnection(ConfigurationManager.ConnectionStrings("conString").ConnectionString)
Dim cmd As New SqlCommand("-placeholder-", conn)
Dim sb As New StringBuilder("Select siteID,siteName,AssetName,Capacity,AvailableFacilities,dateReserved,GroupStatus " & _
",amenities,RentalFeeAmount,ExtraHourAmount,DepositAmount,CancellationAmount,KeyDepositAmount, Duration " & _
" FROM ParksNRecsData WHERE siteId = @siteCode and capacity <= @roomcapacity and (CONVERT(VARCHAR(10), dateReserved, 101) >= @FromDate And CONVERT(VARCHAR(10), dateReserved, 101) <= @EndDate)")
cmd.Parameters.AddWithValue("@siteCode", ddlParks.SelectedValue)
cmd.Parameters.AddWithValue("@roomcapacity", ddlPartySize.SelectedValue)
cmd.Parameters.AddWithValue("@FromDate", txtFromDate.Text)
cmd.Parameters.AddWithValue("@EndDate", txtToDate.Text)
cmd.CommandText = sb.ToString()
Dim dt As DataTable = GetData(cmd)
If dt.Rows.Count = 0 Then
cmd.Parameters.Clear()
cmd.Parameters.AddWithValue("@FromDate", Date.Today.ToString("MM/dd/yyyy"))
cmd.Parameters.AddWithValue("@EndDate", Date.Today.AddMonths(1))
cmd.CommandText = "Select siteID,siteName,AssetName,Capacity,AvailableFacilities,dateReserved,GroupStatus " & _
",amenities,RentalFeeAmount,ExtraHourAmount,DepositAmount,CancellationAmount,KeyDepositAmount, Duration " & _
" FROM ParksNRecsData" & _
" where dateReserved Between @FromDate And @EndDate"
dt = GetData(cmd)
End If
gvCustomers.DataSource = dt
gvCustomers.DataBind()
End Sub
|
|
|
|
|
I need to convert html div content to ms word in below code C# Microsoft.office.interop.word.htmldivision add invalid parameter error occurred.
StringBuilder objStrBuilder = new StringBuilder();
objStrBuilder.Append("<table>");
objStrBuilder.Append("<tr>");
objStrBuilder.Append("<td>");
objStrBuilder.Append("HP");
objStrBuilder.Append("<\td>");
objStrBuilder.Append("<td>");
objStrBuilder.Append("HP computer");
objStrBuilder.Append("<\td");
objStrBuilder.Append("<\tr>");
objStrBuilder.Append("<tr>");
objStrBuilder.Append("<td>");
objStrBuilder.Append("HP Labs");
objStrBuilder.Append("<\td>");
objStrBuilder.Append("<td>");
objStrBuilder.Append("HP computer Joy");
objStrBuilder.Append("<\td");
objStrBuilder.Append("<\tr>");
objStrBuilder.Append("<\table>");
dic.InnerHtml = objStrBuilder.ToString();
Microsoft.Office.Interop.Word.Application word = new Microsoft.Office.Interop.Word.Application();
word = null;
try
{
object missing = System.Reflection.Missing.Value;
word = new Microsoft.Office.Interop.Word.Application();
object template = @"D:\\DS_Template11.dotx";
word.Documents.Add(Template: ref template);
word.Visible = true;
object readOnly = false;
object filename = "http://localhost:60510/tr/Default.aspx";
Microsoft.Office.Interop.Word.Document document = word.Documents.Open(ref filename, ref missing, ref readOnly, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing);
// Microsoft.Office.Interop.Word.Section wordSectio = document.Sections;
foreach (Microsoft.Office.Interop.Word.Section wordSectin in document.Sections)
{
foreach (Microsoft.Office.Interop.Word.HTMLDivision wordSection in document.HTMLDivisions)
{
String text = "this is footer";
//Get the footer range and add the footer details.
Microsoft.Office.Interop.Word.Section s1=document.Sections.Add(); ;
Microsoft.Office.Interop.Word.Paragraph p1 = document.Paragraphs.Add();
Microsoft.Office.Interop.Word.Range R1 = p1.Range;
Microsoft.Office.Interop.Word.HTMLDivision h1= R1.HTMLDivisions.Add();
h1.
R1.ContentControls=dic.
R1.HTMLDivisions = dic.InnerHtml;
//Microsoft.Office.Interop.Word.Range footerRange = wordSection.Footers[Microsoft.Office.Interop.Word.WdHeaderFooterIndex.wdHeaderFooterPrimary].Range;
Microsoft.Office.Interop.Word.HTMLDivision para = wordSection.HTMLDivisions.Add(dic.InnerHtml);
Range.Fields.Add(Range, Microsoft.Office.Interop.Word.WdFieldType.wdFieldHTMLActiveX);
modified 13-Feb-15 6:16am.
|
|
|
|
|
Is this a question, a proud boast, or just some spam?
|
|
|
|
|
Dude this is query sure if know the answer then reply plz
|
|
|
|
|
You still have not asked a question. Please edit your original post and add some proper detail about what problem you are trying to solve, and what errors or problems you are facing.
|
|
|
|
|
I need to convert an HTML Div which is made dynamically and run the page ,entire content of page should be converted into word document on client machine only
|
|
|
|
|
Did you understand what I mean by the statement: Please edit your original post and add some proper detail about what problem you are trying to solve, and what errors or problems you are facing.? Telling us what you want, is not an explanation of a problem.
Also looking at your code you are running some C# code using Microsoft.Office.Interop.Word . Is this running at the server or the client? If the latter then I do not think it will work.
|
|
|
|
|
how do I insert a word, pdf and text to sql database and view the files in gridview using vb.asp
|
|
|
|
|
The same way you would with another technology. Be sure to use a parameterized statement.
|
|
|
|
|
Because those documents can be large and contain images, you should consider storing them in a folder and just store the path string in the db, especially if your db budget is low.
|
|
|
|
|
i am reading pdf files saved on MSSQL server in form of byte array and trying to display in iframe. I am facing the problem. the first file I had opened is opening again and again even deleting cookies and clear up the temp folder. the code I am using is as below:
Dim RID As String
RID = Request.QueryString("RPTID")
Dim rptProp() As String = RPT.getReport(CInt(RID)) 'Reading file attributes from database using a function writtent in an other class.
If rptProp(6) <> "" Then
Filename = rptProp(7)
Me.Filename = Filename
Me.Extension = Mid(rptProp(7), rptProp(7).IndexOf("."c) + 2, rptProp(7).Length)
Dim doc() As Byte = Nothing
doc = RPT.getRepDoc(CInt(RID)) 'Reading exact file bytes stored in MS SQL database using a function getRepDoc(Document_ID as integer) written in another class designed for data communication between web forms and database.
If doc IsNot Nothing Then
If Extension = "pdf" Then
Dim base64String As String = Convert.ToBase64String(doc, 0, doc.Length)
Dim pdfIFrameSrc = "data:Application/pdf;base64,{0}" + base64String
' set the src attribute
Me.iFRM.ResolveUrl(pdfIFrameSrc) ' iFRM is an ID of iFrame
End If
End If
modified 12-Feb-15 5:17am.
|
|
|
|
|
I used the VS2013 Community Edition and created a new MVC Project, and one with the hero accent.
I customized it to my liking, to use as my new website and wanted to start adding web pages to it.
So I created a Controller AppsController.cs and a folder in Views called /Views/Apps
Then I created 4 view pages in Apps, one called MVC.cshtml
I get the page not found, or resource cannot be found when I type in
http://localhost:18525/Apps/MVC[^]
I think my understanding is correct, in which the controller finds the view file. But how does MVC know about the controller, to find the view file. Or perhaps I'm way off track here, and it's a routing issue.
I have no clue here on this
All the help on this says right click, add controller, but I don't get those choices in VS2013 or VS2012. Nor the Add View, I choose Add -> EmptyPage Razor V3.0
I'm not going to post any code since I'm sure what to post.
|
|
|
|
|