|
See the code below: I want to substitute some HTML code by a HTML / asp control, e.g.
<a class="thumb" name="1" href="Images/MapGallery/Large/Metro Service Area Dispatcher Calls Map_L.jpg"
title="Metro Service Area Dispatcher Calls Map" >
How to do it? Thanks.
|
|
|
|
|
Not clear, explain clearly with an example.
|
|
|
|
|
ASP:Hyperlink is the asp version of an a tag.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
Dear all,
I am writing to seek help in writing a linq 'Where' clause to get results between two dates. I am using the following method below, which is currently showing an empty string.
[HttpGet]
public IEnumerable<database_WICs> GetDate(DateTime? start, DateTime? end)
{
var data = from c in db.database_WICs
where c.UploadDate == start &&
c.UploadDate == end
select c;
return data.ToList();
}
http://localhost:45361/api/data?start=25/11/2013&end=28/11/2013
Any help would be very much appreciated.
Many thanks
|
|
|
|
|
try this
[HttpGet]
public IEnumerable<database_WICs> GetDate(DateTime? start, DateTime? end)
{
var data = from c in db.database_WICs
where c.UploadDate == (start==null? c.UploadDate : start) &&
c.UploadDate == (end=null? c.UploadDate : end)
select c;
return data.ToList();
}
|
|
|
|
|
Thank you so much for your response. I tried your code and I am sorry to inform, I got the following error "Cannot convert null to 'bool' because it is a non-nullable value type"
Any help would be very much appreciated.
|
|
|
|
|
miss786 wrote: get results between two dates
miss786 wrote: c.UploadDate == start && c.UploadDate == end
The query you've written will only return records where the UploadDate is equal to the start parameter AND equal to the end parameter. Unless you pass the same value for both parameters, this condition will never be met.
Try something like this:
var data = db.databases_WICs;
if (start != null)
{
data = data.Where(c => c.UploadDate >= start);
}
if (end != null)
{
data = data.Where(c => c.UploadDate <= end);
}
return data.ToList();
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
I really appreciate your time and help. I am currently experiencing error:
Cannot implicitly convert type:'System.Linq.IQueryable<api_09oct.database_wics>' to 'System.Data.Entity.DbSet<api_09oct.database_wics>'. An explicit conversion exists (are you missing a cast?)
on the following lines of code:
if (start != null)
{
data = data.Where(c => c.UploadDate >= start);
}
if (end != null)
{
data = data.Where(c => c.UploadDate <= end);
}
I tried adding FirstOrDefault() to the code but I am sorry to inform that I can not figure out the reason for the issue above.
Thank you
|
|
|
|
|
Try either:
var data = db.databases_WICs.AsQueryable();
or:
IQueryable<database_WICs> data = db.databases_WICs;
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Thanks Richard once again, you have been a great help. I manage to get the issue resolved and the problem was in date converter code that was in the Global.asax file which was not allowing the date parameters to pass through the URL query string.
Thank you so much for your help and time into this issue. I really appreciate it.
|
|
|
|
|
while surfing on internet I found, we can use multiple web.config files in a project. So I want to know how it will work. Which web.config file will refer. Plz give example
|
|
|
|
|
|
I would recommend against it unless you need to. You can't have multiples in the same folder for obvious reasons but sometimes you may want to overwrite a setting in the parent web.config in a subfolder. You may want to research web.config inheritance or better yet, just avoid doing it.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
The root web.config will come first. then if you want to override the settings then you can have more web config in specific folder(View/WebPage folder). if any folder does not have the 2nd web.config then root settings will be affected for your request.
|
|
|
|
|
First of All this is my first if any mistake or wrong message forgive me. coming to Answer, of course we can used the multiple web.config in asp .net web project. Suppose in my project fifty Pages(50), some page are Access only Admin and Some Page access Valid user like that we can used our account information in Code project Account and some are access every user like that About Us page,Login page and So on.My project Pages are divided three parts and Make a Three Folder in Project like name "Admin","Valid User" and Every user. In Admin Folder Add Web.config and Edit the Web.config some change are
<authorization>
<allow users="*" roles="admin"/>
<deny users="?"/>
</authorization>
after than save this web.config.This step are do every folder and save project.
I hope my Bit information try solve your problem.
|
|
|
|
|
I want to display Name and code in drop down I have 2 field one is ddlshiper which drop down list and other one is textbox8 in which code will display
My query is select Temp_Name,Temp_Code from Temp_Shipper
|
|
|
|
|
Hi,
You can bind the 'Temp_Name' as Textfield property of dropdownlist "ddlshiper" and 'Temp_Code' as ValueField property of dropdownlist.
After that, you can create server-side selectedindexchanged event of dropdownlist or javascript selectedindexchanged event where you can set 'Temp_Code' in textbox of selected "Temp_Name" dropdownlist value.
This will resolve your problem.
Thanks,
Dipti Mamidala
modified 9-Dec-13 3:32am.
|
|
|
|
|
Hi All,
I am able to successfully invoke the below .cmd file when i complie it from visual studio, it works fine.
, protected void Button1_Click(object sender, EventArgs e)
{
var p = new Process();
var info = new ProcessStartInfo
{
FileName = Server.MapPath("Test.cmd"),
UseShellExecute = false,
WindowStyle = ProcessWindowStyle.Hidden,
};
p.StartInfo = info;
p.Start();
p.WaitForExit();
Response.Redirect(Request.RawUrl);
}
but when i put these files on IIS 7 and it open the page, but when i click on the button, nothing happens it just refresh the page.
Kindly help on this.
|
|
|
|
|
Try reading the guidelines at the top of the page and don't cross post in multiple forums.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Define "nothing happens". If you're expecting the process to run on the client, then you're going to be disappointed.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
I want to execute the file on the server not on the client machine, but hen i click on the button from client machine it gives file not found error(i think it is looking for the file in the client machine, which is not my need. It should excute on the server. . And i have setup for intranet in iis 7.
|
|
|
|
|
Check the path returned from Server.MapPath("Test.cmd") , and make sure that the file exists in that path on the server.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
The path does exists on the server. when i execute the code on the server it works fine.
But once it host it on iis 7, and open the website on other machine on the button click it gives file not found error.
|
|
|
|
|
Check that the path exists on the server where it doesn't work.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Make sure it does exist on the server where the website is and that the identity running the app pool in IIS has permissions.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|