|
I started with an empty project and progressively added needed packages (with NuGET) as an exercise.
Then I had a working MVC project it was all good.
Then... I tried to use WebAPI, install with 'install-package Microsoft.AspNet.WebApi.Core'
Since then I am in dependency hell, with error such as:
[A]System.Web.WebPages.Razor.Configuration.HostSection cannot be cast to [B]System.Web.WebPages.Razor.Configuration.HostSection. Type A originates from 'System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' in the context 'Default' at location 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.WebPages.Razor\v4.0_2.0.0.0__31bf3856ad364e35\System.Web.WebPages.Razor.dll'. Type B originates from 'System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' in the context 'Default' at location 'C:\Users\ldup\AppData\Local\Temp\Temporary ASP.NET Files\root\2b1093f7\75ec7f6\assembly\dl3\42dbfa84\00c6b4ca_50d0ce01\System.Web.WebPages.Razor.dll'.
I keep fixing error after error I just can't take it anymore....
How do you cope? ...
Better, how do you avoid the problem!!!!
|
|
|
|
|
Look at the version numbers: "...Version=2.0.0.0..." and "...Version=3.0.0.0..."
Make sure that all your projects are targeted to the same version of the .Net framework. It could be necessary to remove some dlls from the reference section of the project, and then later add them back in the correct version...
|
|
|
|
|
Sometimes removing Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35 works.
Though, of course, that is not the recommended way.
|
|
|
|
|
I am new to ASP. So my questions my sound silly.
I am using the VS 2010. I have created a simple myname.aspx file. When I run it within VS it works. I would like to upload it to the WWW server to test. What files besides the myname.aspx would I need? Please find my code below.
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="myname.aspx.vb" Inherits="Lesson1.myname" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<% If Not IsPostBack Then%>
Hello and welcome to my Web site! What is your name?<br />
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<asp:Button ID="Button1" runat="server" Text="Okay" />
<% Else%>
Welcome, <%= TextBox1.Text%>, I'm glad to see you!
Today is: <%= TimeOfDay%>
<% end if %>
</div>
</form>
</body>
</html>
Thank you,
-Jay
|
|
|
|
|
Hi juno101,
As you know in a .net If you want to run a aspx files you need to create a project and in project template has a solution,project and config files.If you build projects or run the whole projects run included its supporting files and finally its create a assemblies and dlls of projects. so you need to upload aspx,web.config and bin folder.
|
|
|
|
|
Thank you very much Sanjay for your help.
Per you advice, I have located the *.dll file under the bin folder. But i am having a hard time locating the 'aspx,web.config'
Please advise,
|
|
|
|
|
Hii..
I Am working on Client Tracking Application(asp.net 4.0 and c sharp),In Which we kept Function FnFillDropDown()
In Global.asax file and called this function on Application_start event inside Global.asax.
FnFillDropdown: this fn basically use to fill dropdown of country, city, common paramter , states names etc.
As this function is kept in global.asax file,when we add new country or state we have to manually reset the iis using iisreset command. Our site is hosted on local network
But we are going to host our site on web very soon .
for that reason we need a quick solution to reset applicatoin state
or tell us how do we call FnFillDrowpDown() Method from Code Behind
My Code is
public class Global : System.Web.HttpApplication
{
private void FnFillDrowpDown()
{
Application.Clear();
BODropDown objBODropDown = new BODropDown();
DADropDown objDADropDown = new DADropDown();
DataTable dtList = new DataTable();
objBODropDown.EntityKey = DDLEntityKey.REG_COUNTRY;
dtList = objDADropDown.GetValueList(objBODropDown);
this.Application.Add(DDLEntityKey.REG_COUNTRY,dtList);
}
public void Application_Start(object sender, EventArgs e)
{
FnFillDrowpDown();
}
}
I have also Tried to call this method using object of class Global but its throws Object Reference not Set..
Error as Application State coming out null..
Please suggest me any solution for this problem as i am new for asp.net
Thanks...
|
|
|
|
|
I want to Convert a text string into hyperlinkable email dynamically (coded either in VB or C#). I have tried some several methods as posted but not successful. If you know some sources, could you share? Thanks.
|
|
|
|
|
I think I originally saw this on CodeProject some years ago, but I can't remember where:
public static string AutoLink(string text)
{
return AutoLinkRegex.Replace(text, match =>
{
string link = match.Value;
int length = link.Length;
int index = length;
while (index > 0 && link[index - 1] == '.')
{
index--;
}
if (index != length)
{
link = link.Substring(0, index);
}
if (link.StartsWith("www.", StringComparison.OrdinalIgnoreCase))
{
return "<a href=\"http://" + link + "\">" + link + "</a>";
}
if (link.StartsWith("ftp.", StringComparison.OrdinalIgnoreCase))
{
return "<a href=\"ftp://" + link + "\">" + link + "</a>";
}
string protocol = match.Groups[1].Value;
if (!string.IsNullOrEmpty(protocol) && protocol[protocol.Length - 1] == '@')
{
return "<a href=\"mailto:" + link + "\">" + link + "</a>";
}
return "<a href=\"" + link + "\">" + link + "</a>";
});
}
private static readonly Regex AutoLinkRegex = new Regex(
@"\b((http://|https://|ftp://|mailto:|news:)|www\.|ftp\.|[^ \,\;\:\!\)\(\""\'\<\>\f\n\r\t\v]+@)([^ \,\;\:\!\)\(\""\'\<\>\f\n\r\t\v]+)",
RegexOptions.IgnoreCase | RegexOptions.Singleline);
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Homer: Thanks SO MUCH for your code!! It works PERFECTLY.
|
|
|
|
|
Good to hear, but my name isn't Homer. That's just a Simpsons quote in my signature.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
i am using two session in my web project,both session pick different different value and i have one page to show with the help of that session. Now how i can use one page for different different session value.
plss help me
|
|
|
|
|
In my project, I planed to databinding images stored in a MS Access file. Per the procedure in Displaying Images from a Database in a GridView[^], the DataImageUrl should be in the GridView Properties Panel. However, when I opened the GridView Properties Panel, there is no DataImageUrl item (only has ClientIDRowSuffix, DataKeyNames, DataMember, DataSourceID in Data Category). Why the DataImageUrl item is not there? Do you know why? Thanks.
|
|
|
|
|
You're looking at the properties of the GridView ; you need to be looking at the properties of the ImageField .
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Homer: Thanks for your post. Per your advice, I went through again step-by-step, and got the problem solved.
|
|
|
|
|
Hey Friends,
Thnx For the help last time, It was great on your part and the error gor solved. But again have stuck up at a point, where i have to upload the images and store it in the questions database.!the question must be in image format and the answers could also be in image format, and i have to save all this in the question database.!
Please Help me out friends.!
|
|
|
|
|
|
Code To upload Your Image to folder
YourFunctionToUploadImage()
{
if (ImageFileUploadControll.HasFile)
{
string fileExtention = System.IO.Path.GetExtension(ImageFileUploadControll.FileName);
if (fileExtention.ToLower() != ".jpg" && fileExtention.ToLower() != ".jpeg" && fileExtention.ToLower() != ".png")
{
lblUploadstatus.Text = "Invalid File Choose .jpg/.jpeg/.png/.gif";
}
else
{
if (File.Exists(Server.MapPath("~/Folder_Name/" + ImageFileUploadControll.FileName)))
{
lblUploadstatus.Text = "File Already Exists. Rename filename";
}
else
{
ImageFileUploadControll.SaveAs(Server.MapPath("~/Folder_Name/" + ImageFileUploadControll.FileName));
lblUploadstatus.Text = "Upload Status : File Uploaded Successfully";
}
}
}
else
{
lblUploadstatus.Text = "Please Select File";
}
}
Code To Retrive All Images form Folder and display in image_control you can use
PageLoadEvent()
{
DirectoryInfo dir = new DirectoryInfo(Server.MapPath("~/Folder_Name/"));
FileInfo[] fi = dir.GetFiles();
foreach(FileInfo f in fi)
{
string imageUrl = f.ToString();
Image img = new Image();
img.ImageUrl = "~/Folder_Name/"+"imageUrl";
}
}
Hope This Help
Pratik Bhuva
---------------
The night is darkest just before the dawn. And I promise you, the dawn is coming
|
|
|
|
|
Can anyone share asp.net 4.0 interview questions.
Regards.
|
|
|
|
|
Your first question: Can you use Google[^]?
Veni, vidi, abiit domum
|
|
|
|
|
I have to say there is no real way to prepare for this: no matter what you study, they'll still manage to ask you something you don't know or have never heard of. You commit that new one to memory and then never get asked it again.
Or they ask you a question; you give the right answer and they tell you you're wrong. Doh!
Cynical? Jaded? Moi?
"If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." Red Adair.
Those who seek perfection will only find imperfection
nils illegitimus carborundum
me, me, me
me, in pictures
|
|
|
|
|
Agree with Mark. This is not a right way to learn.
Here more than couple of ways to learn anything in Internet. Education Needed[^]
Interview questions, Dumps, copy-paste codings are bad for learning.
thatrajaNobody remains a virgin, Life screws everyone
|
|
|
|
|
I don't think those questions will help you if you have no hands on experience in ASP.Net.
|
|
|
|
|
Hey all,
I've got a gridview that is binding images with a 100% width.
The image stretch fine in IE10, Chrome and FF, bit in IE7 the image is its original size.
Is there any workaround for this issue?
|
|
|
|
|
Dear all,
I am currently an novice user in the asp.net environment and would like to request assistance on the following topic below:
I am using 'c.Cover' as field name from database table, which has three types (i.e. talk, cvr, trd). I would like to filter my query, so it prints out yesterday's data with only cvr and trd types only.
from the code below, I am unable to filter my data using the following link below. I still not getting the correct response output from the client side.
http://localhost:38853/api/test?type=CVR&TRD</a>[^]
public IEnumerable<database_WICs> GetPriceType(string type)
{
DateTime yesterday = DateTime.Today.AddDays(-2);
var data = from c in db.database_WICs
where c.UploadDate <= yesterday &&
c.Cover == type &&
c.Cover == type
select c;
return data.ToList();
}
Any help would be much appreciated.
Many thanks for your time and help.
|
|
|
|