|
Please use this form[^]
Please don't forget to mark 'Good Answer', if you find it really a good one!
Kashif
|
|
|
|
|
i had a file upload control,2 buttons and ddl.
one button to insert uploaded image to database and the other to view image as thumbnail..
after i browse the image and before it is stored in db if any postback occurs the filename in textbox dissappears.
once i click on view button image appears but path dissappears before image is inserted in db...
|
|
|
|
|
Yes it's problem with fileupload control. You can seperate controls by iframe.
|
|
|
|
|
how any sample code pls...
|
|
|
|
|
Read about iframes and try to implement that. It may be not suitable for your scenario.
|
|
|
|
|
i am using ASP.Net with c# to develop dynamic web site with backend(database)of mysql and when i search sample code of third membership provider, i got one from this site(The Code Project) and i used it as the steps telling me but when i run my asp.net configuration the error says Could not load type 'Andri.Web.MySqlMembershipProvider'. i couldn't understand it. what shall i do could someone telling me please? i am just a beginer for all of the things, i just doing things by reading reference.
|
|
|
|
|
I think the article that you are using should have some Dll. Check if all the references are loaded correctly. And also read the article, if there is something written on this.
Clearly Andri.Web.MySqlMembershipProvider is a custom written assembly. You need to contact the Author for more help.
|
|
|
|
|
Thank you for your reply.
The article that i used doesn't have dll but has two class which should be pasted to the App_Data folder of my project and made me modification of two items:
<rolemanager defaultprovider="MySqlRoleProvider"
="" enabled="true" .
="" .
<providers="">
<clear>
<add
name="MySqlRoleProvider"
="" type="Andri.Web.MySQLRoleProvider" .
="" .="" <="" providers="">
AND
<membership defaultprovider="MySqlMembershipProvider"
="" userisonlinetimewindow="15">;
<providers>
<clear>
<add
name="MySqlMembershipProvider"
="" type="Andri.Web.MySqlMembershipProvider" .
="" <="" providers="">
in my web.config file.
I also read the article many times and i cross check what i did is according to the steps listed.
And how do i contact the author?
Forum for Article: Membership and Role providers for MySQL
Author: Rakotomalala Andriniaina
|
|
|
|
|
I found the article from where you're implementing that. In point 3, the author is asking to add two files to App_Code folder, those file can be download from the link provided at the top namely 'Download source files'
Don't forget to mark 'Good Answer', if you find it really a good one
|
|
|
|
|
Hello experts,
I want to do is,i have 2 dropdownboxes having names like Country and states ,when i select country then state dropdown box must give respective country's states.Give me way or logic to do this.....
|
|
|
|
|
Why don't you try little bit harder, I know you can do it it's easy
|
|
|
|
|
Hello sir!!
I got little bit idea , i dont knw its true or wrong? its like i can use onchange event of dropdownbox and sql query.....for sql query i required table having fields country and states...
Is it right way?
|
|
|
|
|
|
Hi Kemya,
You can do this using design time & coding. Which u want to prefer...?
Its deepak.
So..Whats Your Rashi?
|
|
|
|
|
Hi Deepak,
I done my design work but how will do this by coding,Do uhave any idia?
For this i have to make table which contain field like country and state?
suggest me proper way!!
|
|
|
|
|
Hi kemu...
Just give ur email id. Or koin me on G-talk.
I will give u straight forward code for it.
OK Sir...
|
|
|
|
|
smartkidya@rediffmail.com
Thanx!!
|
|
|
|
|
Sent..
|
|
|
|
|
Simplest option would be use UpdatePanel put both dropDowns in Update panel , and just write the normal code (ie:- Server side code on Selected Index Change Event of Country DropDown)
|
|
|
|
|
namespace WebApplicationDlh
{
using System;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
using Db;
/// <summary>
/// Area
/// </summary>
public class Area : System.Web.UI.UserControl
{
protected System.Web.UI.WebControls.DropDownList ddlProvince;
protected System.Web.UI.WebControls.DropDownList ddlCity;
public string strProvince
{
get
{
return ddlProvince.SelectedItem.Value;
}
set
{
ddlProvince.SelectedItem.Value = value;
}
}
public string strCity
{
get
{
return ddlCity.SelectedItem.Value;
}
set
{
ddlCity.SelectedItem.Value = value;
}
}
private void Page_Load(object sender, System.EventArgs e)
{
if(!IsPostBack)
{
ddlProvinceBind();
ddlCity.Items.Insert(0,"-City to choose-");
}
}
private void ddlProvinceBind()
{
Db.Area myArea = new Db.Area();
SqlDataReader dr = myArea.GetAllProvince();
if(dr.Read())
{
ddlProvince.DataSource = dr;
ddlProvince.DataTextField = "Province";
ddlProvince.DataValueField = "Province";
ddlProvince.DataBind();
ddlProvince.Items.Insert(0,"-Province to choose-");
}
}
#region Web
override protected void OnInit(EventArgs e)
{
//
// CODEGEN:
//
InitializeComponent();
base.OnInit(e);
}
/// <summary>
///
///
/// </summary>
private void InitializeComponent()
{
this.ddlProvince.SelectedIndexChanged += new System.EventHandler(this.ddlProvince_SelectedIndexChanged);
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
private void ddlProvince_SelectedIndexChanged(object sender, System.EventArgs e)
{
if(ddlProvince.SelectedItem.Value == "-Province to choose-")
{
ddlCity.Items.Clear();
ddlCity.Items.Insert(ddlProvince.SelectedIndex,"-City to choose-");
}
else
{
Db.Area myArea = new Db.Area();
SqlDataReader dr = myArea.GetAllCityWhereProvince(ddlProvince.SelectedItem.Value);
if(dr.Read())
{
ddlCity.DataSource = dr;
ddlCity.DataTextField = "City";
ddlCity.DataValueField = "ID";
ddlCity.DataBind();
}
}
}
}
}
=============================================================〉
using System;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
namespace Db
{
/// <summary>
/// Area
/// </summary>
public class Area:Base
{
public Area()
{
//
// TODO:
//
}
public SqlDataReader GetAllProvince()
{
strSp = "Sp_Area_SelectAll";
drSelectAll(strSp);
return dr;
}
public SqlDataReader GetAllCityWhereProvince(string a)
{
conn = new SqlConnection(ConfigurationSettings.AppSettings["dsn"]);
cmd = new SqlCommand("Sp_Area_SelectAllWhereProvince",conn);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add("@Province",SqlDbType.VarChar,50).Value = a.ToString();
conn.Open();
dr = cmd.ExecuteReader(CommandBehavior.CloseConnection);
return dr;
}
}
}
=====================================================〉
if exists (select * from dbo.sysobjects where id = object_id(N’[dbo].[Sp_Area_SelectAll]’) and OBJECTPROPERTY(id, N’IsProcedure’) = 1)
drop procedure [dbo].[Sp_Area_SelectAll]
GO
if exists (select * from dbo.sysobjects where id = object_id(N’[dbo].[Sp_Area_SelectAllWhereProvince]’) and OBJECTPROPERTY(id, N’IsProcedure’) = 1)
drop procedure [dbo].[Sp_Area_SelectAllWhereProvince]
GO
if exists (select * from dbo.sysobjects where id = object_id(N’[dbo].[Area]’) and OBJECTPROPERTY(id, N’IsUserTable’) = 1)
drop table [dbo].[Area]
GO
CREATE TABLE [dbo].[Area] (
[ID] [int] NOT NULL ,
[Province] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
[City] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
[其它] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL
) ON [PRIMARY]
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE PROCEDURE Sp_Area_SelectAll
AS
SELECT DISTINCT Province
FROM Area
ORDER BY Province
RETURN
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE PROCEDURE Sp_Area_SelectAllWhereProvince
@Province varchar(50)
AS
SELECT Area.*
FROM Area
WHERE (Province = @Province)
RETURN
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
================================================〉
using System;
using System.Data;
using System.Data.SqlClient;
using System.Configuration; namespace Db
{
/// <summary>
/// Base
/// </summary>
public class Base
{
public Base()
{
//
// TODO:
//
}
protected string con = ConfigurationSettings.AppSettings["dsn"];
protected SqlConnection conn;
protected SqlCommand cmd;
protected SqlDataReader dr;
protected string strSp;
protected SqlDataReader drSelectAll(string strSp)
{
conn = new SqlConnection(con);
cmd = new SqlCommand(strSp,conn);
cmd.CommandType = CommandType.StoredProcedure; conn.Open();
dr = cmd.ExecuteReader(CommandBehavior.CloseConnection);
return dr;
}//SqlDataReader }
}
April
Comm100 - Leading Live Chat Software Provider
modified 27-May-14 21:55pm.
|
|
|
|
|
Respected,
Error message : Could not find a part of the path 'C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\BLDocuments\34555.PDF'.
This is the Error of below code.
See below code and tell me why this error created.....help Me ..
string pdfFileNameNew = Request.PhysicalApplicationPath + "PDFsToAttach\\PDFAgent_123 " + DateTime.Now.ToString("dd-MMM-yyyy") + "_" + DateTime.Now.ToString("HHmmss") + ".PDF";
int retVal = CreatePDF(sdrOwnerDetails, sdrReceiverDetails, pdfFileNameNew);
if (retVal == 1)
{
SqlDataReader sdrSBLNo = objReports.GetBLNoDetails(cmbContAndJobs.Text, cmbTypes.Value);
string pdfFileName,MBLpdfFileName, pdfFilePath = String.Empty;
Attachment bookingAttachment = null;
while (sdrSBLNo.Read())
{
pdfFileName = "BLDocuments\\" + sdrSBLNo["BillOfLadingNo"] + ".PDF";
MBLpdfFileName = "MBLDocuments\\" + sdrSBLNo["BillOfLadingNo"] + ".PDF";
if (pdfFileName != String.Empty)
{
pdfFilePath = Request.PhysicalApplicationPath + "BLDocuments\\" + sdrSBLNo["BillOfLadingNo"] + ".PDF";
if (File.Exists(pdfFilePath))
{
bookingAttachment = new Attachment(pdfFileName);
AgentPDFDetails.Attachments.Add(bookingAttachment);
bookingAttachment.Dispose();
AttachedPDFFile(AgentPDFDetails, pdfFileName);
}
}
else if (MBLpdfFileName != String.Empty)
{
pdfFilePath = Request.PhysicalApplicationPath + MBLpdfFileName;
if (File.Exists(pdfFilePath))
{
bookingAttachment = new Attachment(MBLpdfFileName);
AgentPDFDetails.Attachments.Add(bookingAttachment);
bookingAttachment.Dispose();
AttachedPDFFile(AgentPDFDetails, MBLpdfFileName);
}
}
else
{
pdfFilePath = Request.PhysicalApplicationPath + pdfFileNameNew;
if (File.Exists(pdfFilePath))
{
bookingAttachment = new Attachment(pdfFileNameNew);
AgentPDFDetails.Attachments.Add(bookingAttachment);
bookingAttachment.Dispose();
AttachedPDFFile(AgentPDFDetails, pdfFileNameNew);
}
}
}
sdrSBLNo.Close();
sdrSBLNo.Dispose();
}
}
|
|
|
|
|
Is this 'C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\BLDocuments\34555.PDF' path correct for you? I think it's getting path of temp projects of VS, I might be wrong.
|
|
|
|
|
Respected,
So, what I will do now.
Thanks
|
|
|
|
|
You didn't answer my question, the path it's giving error is that path for your project ??
|
|
|
|
|
We are developing an application in ASP.NET (Ms visual studio 2008 - .net framework 2.0). There are 4 developers involved in this project and they will work separate nodes. The application source code will be stored one server (Web Server). There no problem while open the solution in multiple nodes, and all of them can modify. We are facing the problem while running the solution in other then server node. This solution is running in only on the server (where we've maintained the source code). In all other nodes showing security related errors.
Error Detail:
The Application attempted to perform an operation not allowed by the security policy. To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file.
Pls help us how to overcome this issue?
Regards,
Rishi
WinCrs
|
|
|
|