|
You can't do it:
The special hname "body" indicates that the associated hvalue is the body of the message. The "body" hname should contain the content for the first text/plain body part of the message. The mailto URL is primarily intended for generation of short text messages that are actually the content of automatic processing (such as "subscribe" messages for mailing lists), not general MIME bodies.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
whats my option? I can't install outlook on a web server...
|
|
|
|
|
Installing Outlook on the server wouldn't help anyway, since you're trying to open an email message on the client.
There is no way to open an email message on the client pre-populated with an HTML body. You can only pre-populate the message with a plain-text body.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Hi All,
I am trying to list installed programs in client machine using ASP.NET
But it showing only server programs not client
This code working on VB.NET (.exe)
I want to develop a web page
Kindly guide.
Code :
Dim Software As String = Nothing
''The registry key:
Dim SoftwareKey As String = "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall"
Using rk As RegistryKey = Registry.LocalMachine.OpenSubKey(SoftwareKey)
'Let's go through the registry keys and get the info we need:
For Each skName As String In rk.GetSubKeyNames()
Using sk As RegistryKey = rk.OpenSubKey(skName)
Try
'If the key has value, continue, if not, skip it:
If Not (sk.GetValue("DisplayName") Is Nothing) Then
'Is the install location known?
If sk.GetValue("InstallLocation") Is Nothing Then
Software += sk.GetValue("DisplayName") & " - Install path not known" & vbLf
Else
'Nope, not here.
Software += (sk.GetValue("DisplayName") & " - ") + sk.GetValue("InstallLocation") & vbLf
Label1.Text = Software
'Yes, here it is...
End If
End If
Catch ex As Exception
End Try
End Using
Next
End Using
Kirthi
|
|
|
|
|
Web pages are not allowed access to client information like this unless you get the user to download a program which will run on their system. Not many users are likely to allow it.
Veni, vidi, abiit domum
|
|
|
|
|
Thanks for the reply.
The below code which i pasted it is showing my local computer list (web page hosted)
So i tried to get remote location but not working.
Kirthi
|
|
|
|
|
Did you actually read my response? You cannot access the client's registry from code in a web page; it would make the client system vulnerable to all sorts of abuse, viruses, worms etc.
Veni, vidi, abiit domum
|
|
|
|
|
I am not 100% sure but i think You can't do this with ASP.NET, which runs on the server. You need to create an application that is installed and runs on the client machine. It could perhaps collect the information and post it to your site using web services.
|
|
|
|
|
Thanks for the reply.
Kirthi
|
|
|
|
|
plz help me ..
how to develop asp.net web application, connecting to mysql database.
i searched the google for developing asp.net web application .but it's giving membership, profile,role provider.
what r those ,they r must.plz. help me.
|
|
|
|
|
First off don't use txt speak in the forum it is frowned upon.
Secondly, there are 100's of tutorials out there some, probably most will lead you through getting user credentials to access the system. If you do not understand what they are then buy a book on software development or give up now.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Member 10263519 wrote: i searched the google for developing asp.net web application And you didn't find www.asp.net[^]?
Veni, vidi, abiit domum
|
|
|
|
|
Dear all,
I am trying to implement the following method below and I keep experiencing compiler error or "does not contain a definition for 'Where'".
I am already using the library "system.Linq" but I keep getting the same error.
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.Entity;
using System.Data.Entity.Infrastructure;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web;
using System.Web.Http;
namespace API_10Oct.Controllers
{
public class ItemsController : ApiController
{
private TestEntities1 db = new TestEntities1();
public IEnumerable<Intex> GetIntexes()
{
return db.Intexes.AsEnumerable();
}
public IEnumerable<Intex> Get([FromUri]Intex intex)
{
return Intex.Where(w => w.Contains(intex.Name));
}
}
}
namespace API_10Oct
{
using System;
using System.Collections.Generic;
public partial class Intex
{
public string ID { get; set; }
public string Name { get; set; }
public string Price { get; set; }
public string Type { get; set; }
public string UploadDate { get; set; }
}
}
Any guidance or help would be very much appreciated.
Many thanks for your time and help.
|
|
|
|
|
miss786 wrote: return Intex.Where(w => w.Contains(intex.Name));
Intex is a Type , so you are trying to call a static method called Where on that type. Since there is no such method, you're getting a compiler error.
I suspect you meant to write something like:
return db.Intexes.Where(w => w.Contains(intex.Name)).AsEnumerable();
NB: This assumes that the Intext class contains an instance method called Contains which accepts a single string argument and returns a bool . If it doesn't, then you'll need to explain what you're trying to achieve with the filter.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Hi Richard,
Thank you so much for your help. I am trying to create a query string URL using web API which client can use call certain parameters.
I am using the following method below to pass parameters into the query string but I can not get to filter correctly. If search by name=storm and price_type=talk, it produces results with all talk categories instead of filtering by name.storm + price_type.talk.
public HttpResponseMessage Get([FromUri] Query query)
{
var data = from c in db.database_BWICs
where c.Name == query.name ||
c.CUSIP == query.cusip ||
c.ISINs == query.isin ||
c.Cover == query.price_type
select c;
if (data == null)
{
var message = string.Format("No database_WICs was found");
return Request.CreateErrorResponse(HttpStatusCode.NotFound, message);
}
return Request.CreateResponse(HttpStatusCode.OK, data);
}
api/data?name=STORM%202012-2%20A1&price_type=talk --> query string
Is there a way to create a filter using the Linq query, instead of using oData filters?
any help would be very much appreciated.
|
|
|
|
|
miss786 wrote: If search by name=storm and price_type=talk, it produces results with all talk categories instead of filtering by name.storm + price_type.talk.
That's because you're using || (OR) to combine your filters. If you only want to return data which matches all of the filters, then you need to use && (AND) to combine them.
However, based on your URL, it looks like the filters are optional, and you only want to match the filters which have been passed in. In that case, you'll need to check each filter individually, so a series of chained Where calls is probably the simplest option:
var data = db.database_BWICs.AsQueryable();
if (query.name != null)
{
data = data.Where(c => c.Name == query.name);
}
if (query.cusip != null)
{
data = data.Where(c => c.CUSIP == query.cusip);
}
if (query.isin != null)
{
data = data.Where(c => c.ISINs == query.isin);
}
if (query.price_type != null)
{
data = data.Where(c => c.Cover == query.price_type);
}
if (!data.Any())
{
var message = string.Format("No database_WICs was found");
return Request.CreateErrorResponse(HttpStatusCode.NotFound, message);
}
return Request.CreateResponse(HttpStatusCode.OK, data);
You might need to change the filter tests, depending on the data types of the fields.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
suggest me a website in asp dot net
Reply me on richasoni78@ymail.com
modified 19-Nov-13 5:22am.
|
|
|
|
|
I suggest this one[^]
=========================================================
I'm an optoholic - my glass is always half full of vodka.
=========================================================
|
|
|
|
|
i think u r a begginer.
so i want to suggest to create only static site at your first phase.
you can create a site for JWELLERY shops...
DineshT
|
|
|
|
|
If you post a question here (what you posted is not a question), you should expect to see the replies in the thread, not by email! This is a collaborative site, not a personal service.
Posting your email like this is a sure way of attracting huge amounts of spam - I hope you are in need of Viagra and gambling sites!
=========================================================
I'm an optoholic - my glass is always half full of vodka.
=========================================================
|
|
|
|
|
|
Use msdn to learn more about ASP.Net.
Giving your email in a public forum is a never a good idea.
|
|
|
|
|
I have a dropdown list (dlStage) which uses the selected value of another dropdown list (dlJobName) to populate the values. I have both of the ddls set with Autopostback = true but the list dlStage is not populating. I am including the code here for reference. My ultimate goal is to have the user select a value from the dlJobName and then select a value from the dlStage and then the gridview would populate. I had this working when there was basically one stage per JobName. Now there are multiple Stages and the stages are not consistent across jobnames. For example, JobName 123 could have Stage = Release. While 124 would have Stage Final and First. If the update is not done properly, the gridview does not show results or I get an error that the stage does not exist.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;
using System.Web.Security;
using System.Configuration;
namespace AnnoTracker
{
public partial class WebForm1 : System.Web.UI.Page
{
public static class MyVariables
{
public static int PI = 0;
public static string JN = "";
public static string ST = "";
public static string AT = "";
}
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
if (MyVariables.AT == "")
{
dlAnnoType.DataBind();
dlAnnoType.SelectedValue = "Agency Error";
}
if (MyVariables.AT != "")
{
dlAnnoType.DataBind();
dlAnnoType.SelectedValue = MyVariables.AT;
}
if (MyVariables.JN == "")
{
dlJobName.DataBind();
dlJobName.SelectedIndex = 0;
}
if (MyVariables.JN != "")
{
dlJobName.DataBind();
dlJobName.SelectedValue = MyVariables.JN;
}
if (MyVariables.ST == "")
{
dlStage.DataBind();
dlStage.SelectedIndex = 0;
}
dlStage.DataBind();
BindData();
if (MyVariables.PI == 0)
{
gvSummary.DataBind();
gvSummary.PageIndex = 0;
}
if (MyVariables.PI != 0)
{
gvSummary.DataBind();
gvSummary.PageIndex = MyVariables.PI;
}
}
}
protected void EditSummary(object sender, GridViewEditEventArgs e)
{
gvSummary.EditIndex = e.NewEditIndex;
string _custName = gvSummary.DataKeys[e.NewEditIndex].Value.ToString();
BindData();
}
protected void CancelEdit(object sender, GridViewCancelEditEventArgs e)
{
gvSummary.EditIndex = -1;
BindData();
}
protected void gvSummary_PageIndexChanging(object sender, GridViewPageEventArgs e)
{
gvSummary.PageIndex = e.NewPageIndex;
MyVariables.PI = e.NewPageIndex;
BindData();
}
protected void RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow && gvSummary.EditIndex == e.Row.RowIndex)
{
DropDownList dlBU = (DropDownList)e.Row.FindControl("dlBU");
string _custName = gvSummary.DataKeys[e.Row.RowIndex].Values[1].ToString();
string BUquery = "select distinct Unit from vw_BU where Business='" + _custName + "'";
SqlCommand BUcmd = new SqlCommand(BUquery);
dlBU.DataSource = GetData(BUcmd);
dlBU.DataTextField = "Unit";
dlBU.DataValueField = "Unit";
dlBU.DataBind();
dlBU.Items.FindByValue((e.Row.FindControl("lblBU") as Label).Text).Selected = true;
DropDownList dlPA = (DropDownList)e.Row.FindControl("dlPA");
string _PAcustName = gvSummary.DataKeys[e.Row.RowIndex].Values[1].ToString();
string PAquery = "select PA from PA where Business='" + _PAcustName + "' order by PA";
SqlCommand PAcmd = new SqlCommand(PAquery);
dlPA.DataSource = GetData(PAcmd);
dlPA.DataTextField = "PA";
dlPA.DataValueField = "PA";
dlPA.DataBind();
dlPA.Items.FindByValue((e.Row.FindControl("lblPA") as Label).Text).Selected = true;
DropDownList dlET = (DropDownList)e.Row.FindControl("dlET");
string ETquery = "select distinct ErrorType from ErrorType order by ErrorType";
SqlCommand ETcmd = new SqlCommand(ETquery);
dlET.DataSource = GetData(ETcmd);
dlET.DataTextField = "ErrorType";
dlET.DataValueField = "ErrorType";
dlET.DataBind();
dlET.Items.FindByValue((e.Row.FindControl("lblET") as Label).Text).Selected = true;
DropDownList dlAA = (DropDownList)e.Row.FindControl("dlAA");
string AAquery = "select distinct AAA from ActualAgencyError";
SqlCommand AAcmd = new SqlCommand(AAquery);
dlAA.DataSource = GetData(AAcmd);
dlAA.DataTextField = "AAA";
dlAA.DataValueField = "AAA";
dlAA.DataBind();
dlAA.Items.FindByValue((e.Row.FindControl("lblAA") as Label).Text).Selected = true;
DropDownList dlSupport = (DropDownList)e.Row.FindControl("dlSupport");
string SupQuery = "select distinct Support from Support";
SqlCommand Supcmd = new SqlCommand(SupQuery);
dlSupport.DataSource = GetData(Supcmd);
dlSupport.DataTextField = "Support";
dlSupport.DataValueField = "Support";
dlSupport.DataBind();
dlSupport.Items.FindByValue((e.Row.FindControl("lblSupport") as Label).Text).Selected = true;
}
}
protected void UpdateSummary(object sender, GridViewUpdateEventArgs e)
{
MyVariables.AT = dlAnnoType.SelectedValue;
MyVariables.JN = dlJobName.SelectedValue;
MyVariables.ST = dlStage.SelectedValue;
MyVariables.PI = gvSummary.PageIndex;
string BU = (gvSummary.Rows[e.RowIndex].FindControl("dlBU") as DropDownList).SelectedItem.Value;
string ET = (gvSummary.Rows[e.RowIndex].FindControl("dlET") as DropDownList).SelectedItem.Value;
string AA = (gvSummary.Rows[e.RowIndex].FindControl("dlAA") as DropDownList).SelectedItem.Value;
string PA = (gvSummary.Rows[e.RowIndex].FindControl("dlPA") as DropDownList).SelectedValue;
string AnnotationNumber = gvSummary.DataKeys[e.RowIndex].Value.ToString();
string sgkComments = (gvSummary.Rows[e.RowIndex].FindControl("tbsgkComm") as TextBox).Text;
string Support = (gvSummary.Rows[e.RowIndex].FindControl("dlSupport") as DropDownList).SelectedValue;
string SupportName = (gvSummary.Rows[e.RowIndex].FindControl("tbSupportName") as TextBox).Text;
string BusImpact = (gvSummary.Rows[e.RowIndex].FindControl("tbBusImpact") as TextBox).Text;
string strConnString = ConfigurationManager.ConnectionStrings["SRM_MetricConnectionString"].ConnectionString;
using (SqlConnection con = new SqlConnection(strConnString))
{
string query = "update vw_GridviewSource set [BusinessUnit] = @BU, [ErrorType] = @ET, [sgkComments] = @sgk, [ActualAgencyError] = @AA, [PA] = @PA, [Support] = @Support, [SupportName] = @SupportName, [BusImpact] = @BusImpact where [AnnotationNumber] = @AnnoNum";
using (SqlCommand cmd = new SqlCommand(query))
{
cmd.Connection = con;
cmd.Parameters.AddWithValue("@BU", BU);
cmd.Parameters.AddWithValue("@AnnoNum", AnnotationNumber);
cmd.Parameters.AddWithValue("@ET", ET);
cmd.Parameters.AddWithValue("@AA", AA);
cmd.Parameters.AddWithValue("@sgk", sgkComments);
cmd.Parameters.AddWithValue("@PA", PA);
cmd.Parameters.AddWithValue("@Support", Support);
cmd.Parameters.AddWithValue("@SupportName", SupportName);
cmd.Parameters.AddWithValue("@BusImpact", BusImpact);
con.Open();
cmd.ExecuteNonQuery();
con.Close();
Response.Redirect(Request.Url.AbsoluteUri);
}
}
gvSummary.PageIndex = MyVariables.PI;
gvSummary.DataBind();
BindData();
}
private void BindData()
{
gvSummary.PageIndex = MyVariables.PI;
gvSummary.DataBind();
if (MyVariables.JN != "" && MyVariables.ST != "" && MyVariables.AT != "")
{
dlJobName.SelectedValue = MyVariables.JN;
dlJobName.DataBind();
dlStage.SelectedValue = MyVariables.ST;
dlStage.DataBind();
dlAnnoType.SelectedValue = MyVariables.AT;
dlAnnoType.DataBind();
}
gvSummary.PageIndex = MyVariables.PI;
gvSummary.DataBind();
String conString = System.Configuration.ConfigurationManager.ConnectionStrings["SRM_MetricConnectionString"].ConnectionString;
string query = "select [Page_ID],[AnnotationNumber],[AnnotationBy],[PA],[AnnotationType],[BusinessUnit] as Unit,[ErrorType],[ActualAgencyError],AnnotationComments,[sgkComments],[ActualAgencyError],Support,SupportName, BusImpact,Cust from vw_GridviewSource order by [Page_ID]";
SqlCommand cmd = new SqlCommand();
if (dlJobName.SelectedValue != "" & dlStage.SelectedValue != "")
{
query = "select [Page_ID],[AnnotationNumber],[AnnotationBy],[PA],[AnnotationType],[BusinessUnit] as Unit,[ErrorType],[ActualAgencyError],AnnotationComments,[sgkComments],[ActualAgencyError],Support,SupportName, BusImpact,Cust from vw_GridviewSource where Name = '" + dlJobName.SelectedValue + "' and AnnotationDate = '" + dlStage.SelectedValue + "' order by [Page_ID]";
}
if (dlAnnoType.SelectedValue != "" && (dlJobName.SelectedValue.Length < 2 && dlStage.SelectedValue.Length < 2))
{
query = "select [Page_ID],[AnnotationNumber],[AnnotationBy],[PA],[AnnotationType],[BusinessUnit] as Unit,[ErrorType],[ActualAgencyError],AnnotationComments,[sgkComments],[ActualAgencyError],Support,SupportName, BusImpact,Cust from vw_GridviewSource where AnnotationType = '" + dlAnnoType.SelectedValue + "' order by [Page_ID]";
}
if (dlAnnoType.SelectedValue != "" && (dlJobName.SelectedValue != "" && dlStage.SelectedValue != ""))
{
query = "select [Page_ID],[AnnotationNumber],[AnnotationBy],[PA],[AnnotationType],[BusinessUnit] as Unit,[ErrorType],[ActualAgencyError],AnnotationComments,[sgkComments],[ActualAgencyError],Support,SupportName, BusImpact,Cust from vw_GridviewSource where AnnotationType = '" + dlAnnoType.SelectedValue + "' and Name = '" + dlJobName.SelectedValue + "' and AnnotationDate = '" + dlStage.SelectedValue + "' order by [Page_ID]";
}
cmd.CommandText = query;
SqlConnection con = new SqlConnection(conString);
cmd.CommandType = CommandType.Text;
cmd.Connection = con;
SqlDataAdapter sda = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
sda.Fill(ds);
gvSummary.DataSource = ds;
gvSummary.PageIndex = MyVariables.PI;
gvSummary.DataBind();
}
private DataTable GetData(SqlCommand cmd)
{
string strConnString = ConfigurationManager.ConnectionStrings["SRM_MetricConnectionString"].ConnectionString;
using (SqlConnection con = new SqlConnection(strConnString))
{
using (SqlDataAdapter sda = new SqlDataAdapter())
{
cmd.Connection = con;
sda.SelectCommand = cmd;
using (DataTable dt = new DataTable())
{
sda.Fill(dt);
return dt;
}
}
}
}
protected void dlJobName_SelectedIndexChanged(object sender, EventArgs e)
{
MyVariables.JN = dlJobName.SelectedValue;
dlJobName.DataBind();
MyVariables.ST = dlStage.SelectedValue;
dlStage.DataBind();
MyVariables.AT = dlAnnoType.SelectedValue;
dlAnnoType.DataBind();
BindData();
MyVariables.PI = gvSummary.PageIndex;
gvSummary.DataBind();
}
protected void dlStage_SelectedIndexChanged(object sender, EventArgs e)
{
MyVariables.JN = dlJobName.SelectedValue;
MyVariables.ST = dlStage.SelectedValue;
MyVariables.AT = dlAnnoType.SelectedValue;
gvSummary.DataBind();
BindData();
}
protected void dlAnnoType_SelectedIndexChanged(object sender, EventArgs e)
{
MyVariables.AT = dlAnnoType.SelectedValue;
MyVariables.JN = dlJobName.SelectedValue;
MyVariables.ST = dlStage.SelectedValue;
gvSummary.DataBind();
BindData();
}
}
}
TIA
Tim Vavra
|
|
|
|
|
What you're looking for is commonly called a "cascading dropdown list". There are quite a few articles which explain how to achieve this; for example:
http://www.aspsnippets.com/Articles/Creating-Cascading-DropDownLists-in-ASP.Net.aspx[^]
Your code has some other obvious problems:
- Your queries in the
RowDataBound and BindData methods are susceptible to SQL Injection[^]. You need to replace the string concatenation with parameterized queries. - You are storing page-specific state in static fields. The value of a static field will be shared across every request from every user for the lifetime of the AppDomain, which is not what you want.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
HOW TO CREATE FEEDBACK FORM SO THAT ANY USER CAN SEND MESSAGE TO MY STATIC EMAIL-ID??
|
|
|
|
|