|
I've clicked help on the manager and it showed microsoft one instead. So I was led astray a bit.
Чесноков
|
|
|
|
|
Try this
string connectionString =
System.Web.Configuration.WebConfigurationManager.ConnectionStrings["Northwind"].ConnectionString;
|
|
|
|
|
many thanks that works also but a bit lengthy
Чесноков
|
|
|
|
|
Hi,
I am currently working on creating a custom listbox control in asp.net and c#, I used as an example to work from a project found here
Custom List Box with Cool Effects[^
I want to edit this so that the image and text call onclick events in the C# behind them, does anyone have any idea of how to do this, the problem is the way the code works is that it adds HTML, so I cannot simply place <asp:imagebutton> in the code instead of a html button as this does not work
Thanks
|
|
|
|
|
Welcome,
Look this page
http://aspnet.4guysfromrolla.com/demos/dgExample12.aspx
Description: datagird in the table which the fiks has three lines of TR-is.
Is it any way possible to have once three lines once again 10 lines, depending what I get results from Select.
thanks
|
|
|
|
|
hi all,
please help me in this i am trying to achieve the functionality like zeeweb splitter control.how can i do this by java script or Ajax controls or guide me if any links are available for this how to approach using asp.net and C#.
Thanks And Regards,
Guru
|
|
|
|
|
I've got IIS 7.0 and Vista. I'm trying to access WebConfigurationManager which comes from microsoft.web.administration namaspace. But it is not in the references available to add from solution explorer.
Which is the directory where can I find it on my PC?
Чесноков
|
|
|
|
|
It should be over there,
C:\WINDOWS\system32\inetsrv
|
|
|
|
|
thank you, it was there.
but there is no property ConnectionStrings in WebConfigurationManager.
am I missing another assembly added?
string connectionString =
WebConfigurationManager.ConnectionStrings["Northwind"].ConnectionString;
error, no ConnectionStrings property in the WebConfigurationManager
Чесноков
|
|
|
|
|
Chesnokov Yuriy wrote: string connectionString =
WebConfigurationManager.ConnectionStrings["Northwind"].ConnectionString;
error, no ConnectionStrings property in the WebConfigurationManager
I think you are doing some thing wrong. You need only System.Web.dll for that
WebConfigurationManager Class[^]
|
|
|
|
|
many thanks, that is the right one.
Чесноков
|
|
|
|
|
Welcome
|
|
|
|
|
i have a page containing multiple textboxes which have menu items which i want to store into mysql database. These items would be stored in "menu_items" column of table. i want code to store these values into database
modified on Monday, August 10, 2009 3:58 AM
|
|
|
|
|
Alright, and the problem is?
|
|
|
|
|
SO you have made as if you know what you are doing Its easy why dont you ask
(How do i run an insert to mySQL Table) then we will answer you. Now another thing is that before you post you must first Google. there are plenty of examples on the net
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.somee.com
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
HI
i have create a project having VSJLIB reference in it
when i have code it as follows
public void CreateZipFile(string sPath)
{
FileOutputStream stream1 = null;
ZipOutputStream stream2 = null;
if (System.IO.File.Exists(sPath))
{
FileInfo info2 = new FileInfo(sPath);
stream1 = new FileOutputStream(sPath.Replace
(info2.Extension, ".zip"));
stream2 = new ZipOutputStream(stream1);
this.ZipOneFile(stream1, stream2, sPath);
}
else if (Directory.Exists(sPath))
{
stream1 = new FileOutputStream(sPath + ".zip");
stream2 = new ZipOutputStream(stream1);
DirectoryInfo info1 = new DirectoryInfo(sPath);
this.ZipDirectory(stream1, stream2, info1, sPath);
}
stream2.close();
stream1.close();
stream2.flush();
stream1.flush();
}
private void CopyStream(FileInputStream src, ZipOutputStream
dest)
{
InputStreamReader reader1 = new InputStreamReader(src);
OutputStreamWriter writer1 = new OutputStreamWriter(dest);
while (reader1.ready())
{
writer1.write(reader1.read());
}
writer1.flush();
}
private void ZipDirectory(FileOutputStream fos, ZipOutputStream
zos, DirectoryInfo di, string SRootDir)
{
FileInfo[] infoArray2 = di.GetFiles();
foreach (FileInfo info2 in infoArray2)
{
ZipEntry entry1 = new ZipEntry
(info2.FullName.Substring(SRootDir.LastIndexOf(@"\")));
entry1.setMethod(8);
zos.putNextEntry(entry1);
FileInputStream stream1 = new FileInputStream
(info2.FullName);
this.CopyStream(stream1, zos);
zos.closeEntry();
stream1.close();
}
DirectoryInfo[] infoArray1 = di.GetDirectories();
foreach (DirectoryInfo info1 in infoArray1)
{
this.ZipDirectory(fos, zos, info1, SRootDir);
}
}
but when i run the code it gives me excetion
java.io.File.getCanonicalPath()
what should i do to run the code ???
any suggesations ???
thanx in advnace
koolprasad2003
Be a good listener...Because Opprtunity knoughts softly...N-Joy
|
|
|
|
|
i want to change the url property of the embeded object(media player) in my webpage....
is it possible through javascript or codebehind. sample code help???? thnks in advance
|
|
|
|
|
That Should be Easy in your markup not server site , there is an <embed /> tag, inside it , there is an object and a URL, just change the URL there.
Hope this Helps
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.somee.com
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
thanks but i want to change it dynamically.....
|
|
|
|
|
It is Still Simple. That object has an object ID , so on server side you can do that dynamically by calling the object id
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.somee.com
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
I m facing 'originalWidth' is null or not an object javascript error on my aspx web page, i m hiding and showing panel based on checkbox, the panel contains some of the ajax validationCalloutExtender controls , when i m clicking on submit button i m getting the error as -
'originalWidth' is null or not an object"
Can someone help regarding this issue.
Thanks in advanced
Rahul
|
|
|
|
|
I have a small survey application that I put together within an ASP.NET CMS (sitefinity). The logic of the survey is to store the SelectedItems from the various button list controls in hidden fields (upon button clicks). As each question is answered a new panel of questions is made visible and the answered questions are hidden.
Upon completion the final event is to email the SelectedItems along with a large HTML message to the user. The SelectedValues are placed in various locations of the HTML message. A mail merge if you will.
Here is my problem: I can only get the SelectedItems into the HTML message under certain limited conditions.
1. Using a Token Replacement scheme allows me to "Tokenize" the fields within a static ASPX page. However, the tokens can't be linked to the server controls (the hidden fields) inside of the user control .ascx file.
Here is an example of my code for this situation.
.ascx
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="NeedsSurvey.ascx.cs" Inherits="NeedsSurvey_NeedsSurvey" ClassName="NeedSurvey" %>
<asp:Panel runat="server" ID="panel1">
1. Which of the following best describes the personal needs you feel are the most
immediate?
<br />
<br />
<asp:RadioButtonList ID="RadioButtonList1" runat="server">
<asp:ListItem>Help with everday expenses</asp:ListItem>
<asp:ListItem>Paying off debt</asp:ListItem>
<asp:ListItem>Taking a vacation</asp:ListItem>
<asp:ListItem>Home improvments</asp:ListItem>
<asp:ListItem>Better medical coverage</asp:ListItem>
</asp:RadioButtonList>
<asp:Button ID="Button1" runat="server" Text="Button" OnClick="btn_Click1" />
<asp:Label ID="Label1" runat="server"></asp:Label>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="RadioButtonList1"
ErrorMessage="Please select an answer"></asp:RequiredFieldValidator>
</asp:Panel>
<asp:HiddenField ID="q1" runat="server" />
Here is the code behind
.ascs.cs
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Net.Mail;
using System.Net;
using System.IO;
public partial class NeedsSurvey_NeedsSurvey : System.Web.UI.UserControl
{
#region EventHandlers
protected void btn_Click1(object sender, EventArgs e)
{
try
{
panel1.Visible = false;
panel2.Visible = true;
}
catch (Exception ex)
{
Label1.Text = ex.Message;
}
q1.Value = RadioButtonList1.SelectedItem.Text;
}
#endregion
public void Confirm_Send(object sender, EventArgs e)
{
MailMessage mail = new MailMessage();
mail.From = new MailAddress("xxx.com");
mail.To.Add("xxx.com");
mail.Subject = "Website Lead";
string html = ScreenScrapeHtml("http://localhost/demo/mycontrols/needssurvey.aspx");
mail.Body = html;
mail.IsBodyHtml = true;
SmtpClient smtp = new SmtpClient("xxx.com");
smtp.Credentials = new System.Net.NetworkCredential("xxx", "xxx");
smtp.Send(mail);
}
public string ScreenScrapeHtml(string url)
{
WebRequest objRequest = System.Net.HttpWebRequest.Create(url);
StreamReader sr = new StreamReader(objRequest.GetResponse().GetResponseStream());
string result = sr.ReadToEnd();
sr.Close();
return result;
}
}
The ASPX page is just an HTML formatted message that looks like, "Dear [$FirstName$], etc" with a code behind file for Tokenizing. The code for this was written by Damon Armstrong and can be found Here. I used the code exactly as written. Again, the problem is I can't get my hidden fields to link to the external ASPX page nor can I tokenize them.
2. The other method is to place the html message in the User Control within a Literal control and call the control at the SEND email event. Unfortunately you can not place server controls within a Literal control to call the values of the hidden fields, nor is it possible to use a because System.Net.Mail returns an error that the contents of the are not literal.
It is possible to Tokenize the fields (because the token code is used within the User Control, the hidden fields are available, unlike the external ASPX method) within the Literal control but they will only render on PageLoad. Calling the Literal control and sending through System.Net.Mail does not render the tokens only "Dear [$FirstName$], NOT Dear John.
Sorry for the length of this, but I wanted to make sure I included everything I tried.
One final Note. I do know that I can use server control fields using System.Net.Mail, but my HTML message is much more long and complicated to make that a viable solution.
Thanks.
joe
|
|
|
|
|
How web owners r making money by sending free sms for free registered users? eg: 160by2.com, way2sms.com
|
|
|
|
|
Well, not really a programming question. But let us think about this: How is Google making money? Right, advertising. So I guess the sites you mentioned are full of commercials. That is how they make money...
Regards
Sebastian
|
|
|
|
|
This has nothing to do with ASP.NET .
|
|
|
|