|
You can do it using ActiveX Components. But this will work only on IE .
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
If you use Ajax you can make calls to a web host if the C# dll accepts post request, you can translate your requests through an ASP.NET page, or if you use Silverlight you can interact with silverlight from Javascript. Each choice has pro's and con's.
If you really want seamless interaction, use Java and Live Connect.
|
|
|
|
|
Create one HttpHandler, in that reference the dll and do all you need in ProcessRequest.
From javascript, call the handler to fetch the response.
If you want to use Javascript to access WebMethod, you can also do that using PageMethod, for which you need to expose the methods as Web Service.
Take a look into this :
http://forums.asp.net/p/1266663/2382644.aspx[^]
|
|
|
|
|
Hi experts ,
Is there any way to use "System.Web.UI.ScriptManager" in FW2.0..is there any alternative control for this ?
|
|
|
|
|
I think if you install AJAX framework, it will work in Framework 2.0...
|
|
|
|
|
Hi, I have to download a doc file and show the pdf file in the browser. For that I have used the following code in JavaScript of the button click
window.open(url, 'Download', 'height=1,width=1,top=0,left=-1000');
where url represent the path of the file (http://localhost/website/filename.doc).I do not want to show the popup window, for that I have used left=-1000, but it does not effect. Do you have any idea how I can hide that popup window
Pankaj
|
|
|
|
|
Does anyone have the solution
Pankaj
|
|
|
|
|
Hey, I have created following code. But button event is not firing. Please look at the code and tell me where I am doing wrong.
namespace immu.control
{
[ToolboxData("<{0}:myControl runat=server></{0}:myControl>")]
public class docControl : WebControl
{
public Button btn;
protected override void CreateChildControls()
{
Panel pnl = new Panel();
btn = new Button();
btn.Text = "Click Me";
btn.Click += new EventHandler(btn_Click);
pnl.Controls.Add(btn);
this.Controls.Add(pnl);
}
public void btn_Click(object sender, EventArgs e)
{
HttpContext.Current.Response.Redirect("http://google.com");
}
}
}
Thanks.
Imrankhan
please don't forget to vote on the post that helped you.
|
|
|
|
|
The problem is solved.
Thanks.
please don't forget to vote on the post that helped you.
|
|
|
|
|
Hi,
I am working on ASP.NET(c#)/SQL Server project. I my project i want to have the textbox to show the text like the text in "SQL Script".
e.g: When we write the query in sql Server the color of reserved words (like "select", "where" etc) changes to blue, the color of commented lines changes to green and the other text remains the same.
Please guide me how to do this.
Sonia
|
|
|
|
|
Create a list of reserved words, and as the user types in check the word against your list and colour appropriately.
Bob
Ashfield Consultants Ltd
Proud to be a 2009 Code Project MVP
|
|
|
|
|
How can i use different colors in a single textbox.
|
|
|
|
|
It was a trick answer. Of course you can't, you need to put it into some other sort of control, say a div, and you will have to do it in javascript unless you want to post back to the server each time. Now use you initiative and google, there are loads of examples
Bob
Ashfield Consultants Ltd
Proud to be a 2009 Code Project MVP
|
|
|
|
|
You can not do it in TextBox, You have to use div element. On keypress event, you have to call javascript function where you need to read all string of div by splinting space and check if word are in listing then add font attribute or span attribute around word and set style.
Search in google for how to write on div element.
Regard
Imrankhan
please don't forget to vote on the post that helped you.
|
|
|
|
|
I do not have too much knowledge of javascript. Please tell me the solution in c#.
|
|
|
|
|
Is there any way to use web proxy with SmtpClient Class.
I have to send mail from mail server smtp.gmail.com
If internet is directly available on my machine then everything is working fine. I can send a mail.
If My system is using proxy by proving it in Network connections then also it is working fine. But when i remove the proxy settings from Network connection and
Create a WebProxy object and assign Valid host and port then WebRequest object return HttpWebResponse properly ,
But i am not able to send mail by using SmtpClient.
I have even tried:
1) WebRequest.DefaultWebProxy
2) GlobalProxySelection.Select
3) DefaultProxy in Web.config
but result in Vain
I cant set Proxy in my network connection. Is there some work around to send mail. Either using TcpClient or any way.
Vikas Agarwal
|
|
|
|
|
Hi to all,
I am using a gridview to display products with a link "view details". When the user clicks on the "view details" for a product, all the details are displayed in the detailsview control. I the edit mode , if user don't want to edit the image, then the initial path saved in the label should go. The path is going but image is not displayed. I am unable to find the problem. Here is the code:
<br />
<asp:TemplateField HeaderText="Image"><br />
<ItemTemplate><br />
<asp:Label ID="lblimage" runat="server" Text='<%# Eval("image") %>' /><br />
</ItemTemplate><br />
<EditItemTemplate><br />
<asp:Label ID="labelImage" runat="server" Text='<%# Eval("image") %>' /><br />
<asp:FileUpload ID="UpldImage" runat="server" /><br />
</EditItemTemplate><br />
</asp:TemplateField><br />
FileUpload UpldImage = (FileUpload)DetailsView1.FindControl("UpldImage");
Label labelImage = (Label)DetailsView1.FindControl("labelImage");
string im = labelImage.Text;
if (UpldImage.HasFile)
{
string fileName = "~/ProductImages/" + UpldImage.FileName;
SqlDataSource2.UpdateParameters["image"].DefaultValue = fileName;
UpldImage.SaveAs(Server.MapPath(fileName));
}
else
{
SqlDataSource2.UpdateParameters["image"].DefaultValue = im;
UpldImage.SaveAs(Server.MapPath(im));
}
Please assist me...where I am going wrong.
cheers,
sneha
|
|
|
|
|
if (UpldImage.HasFile ) is False
Why do you need to cal UpldImage.SaveAs ??
If there is no file, no need to cal SaveAs.
Also you forgot to mention, what problem you are getting..
|
|
|
|
|
Hi,
The problem is that in the edit mode of details view a label and a file upload control is shown for the image. In the label control the current path is displayed. If the user doesn't changes the image then the path in label goes in the update function. And if the user changes the file then the path from the file upload control goes.
My problem is if the user does not change the image then the path from the label goes well but the image disappears from the front end. If I again choose the path from the file uploader then the image appears.
cheers,
sneha
|
|
|
|
|
strange behaviour is that the two paths for the image (one in the label and second when I again choose from the file upload) are same.But the image appears only when the path is choosen from the file upload.
cheers,
sneha
|
|
|
|
|
If you have already image in database and If user does not want to update image then why are you calling update method.
There are two ways.
1. dont update database if user does not select the file.
FileUpload UpldImage = (FileUpload)DetailsView1.FindControl("UpldImage");
Label labelImage = (Label)DetailsView1.FindControl("labelImage");
string im = labelImage.Text;
if (UpldImage.HasFile)
{
string fileName = "~/ProductImages/" + UpldImage.FileName;
SqlDataSource2.UpdateParameters["image"].DefaultValue = fileName;
UpldImage.SaveAs(Server.MapPath(fileName));
}
2. Update database if you want but dont save image again because you have already file in folder.
FileUpload UpldImage = (FileUpload)DetailsView1.FindControl("UpldImage");
Label labelImage = (Label)DetailsView1.FindControl("labelImage");
string im = labelImage.Text;
if (UpldImage.HasFile)
{
string fileName = "~/ProductImages/" + UpldImage.FileName;
SqlDataSource2.UpdateParameters["image"].DefaultValue = fileName;
UpldImage.SaveAs(Server.MapPath(fileName));
}
else
{
SqlDataSource2.UpdateParameters["image"].DefaultValue = im;
}
If you dont want to update any code, then please check else condition, what does im contain? and after executing else code, please check your folder to verify that file is exist or not. degun the code, you will get an idea.
Regard
please don't forget to vote on the post that helped you.
|
|
|
|
|
Imran Khan Pathan wrote: If you dont want to update any code, then please check else condition, what does im contain? and after executing else code, please check your folder to verify that file is exist or not. degun the code, you will get an idea.
I already checked the else condition and on debugging found that "im" contains the correct path. And the image folder still contains the image. But strange behaviour is image disappears.
I dont know why it is happening.
cheers,
sneha
|
|
|
|
|
Hi all,
can anybody pls tell me which software is better to create flash file by using my photo albums.So that i want to include it in my home page.
advance thanks
|
|
|
|
|
Did you try Adobe Flash ?
You can easily import images to the Flash timeline and render to a Flash movie.
|
|
|
|
|
What is the use of enableEventValidation="false" and enableEventValidation="true" ?
|
|
|
|