|
Thanks - but didn't help.
This is so odd - the line that checks if the folder exists works:
If Not System.IO.Directory.Exists(Server.MapPath("subfolderX")) Then
because if I replace subfolderX with one that does already exist then it returns true; but if subfolderX doesn't then
System.IO.Directory.CreateDirectory(Server.MapPath("subfolderX"))
fails with a "Cannot find part of path" error. As I can create folders by hard-coding the network path I assume it isn't a permissions thing. (Unless there are different permissions to creating network folders from virtual ones..? Never have understood this side of things...) And saving files works.
J4amieC wrote: but the chance of finding and speaking to a programmer there that understands such matters is slim!.
Indeed....!
Oh well... thanks for trying folks
cheers
P
|
|
|
|
|
Hello There
There is a search form in my scenario in which user will fetch say 100 records in one go. and then he has button "Next 100". Now I am adding the next button dynamically . but the addhandler is not working.
Can any one help me how to make sure that handler should work. The code is
' I have a server side table in which I am adding rows and cells
Dim cellBtnPrevious As New System.Web.UI.WebControls.TableCell
Dim btnRow As New System.Web.UI.WebControls.TableRow
Dim BtnPrevious As New System.Web.UI.WebControls.Button
Dim BtnNext As New System.Web.UI.WebControls.Button
Dim BtnWidth As New System.Web.UI.WebControls.Unit(100)
BtnPrevious.Width = BtnWidth
btnNext.Width = BtnWidth
BtnPrevious.Text = "Previous"
BtnNext.Text = "Next"
AddHandler BtnNext.Click, AddressOf NextRecords
AddHandler BtnPrevious.Click, AddressOf PreviousRecords
cellBtnNext.Controls.Add(BtnNext)
cellBtnPrevious.Controls.Add(BtnPrevious)
btnRow.Cells.Add(cellBtnNext)
btnRow.Cells.Add(cellBtnPrevious)
tblContents.Controls.Add(btnRow)
'' The definition of one function is
Private Sub NextRecords(ByVal sender As System.Object, ByVal e As System.EventArgs)
'' code here
end sub
Thanks
Regards
Rizwan Bashir
|
|
|
|
|
I am defining relationship between datatables by using oracle as the backend.
It works fine in sql but in oracle it prompts an error "OBJECT REFERENCE NOT SET TO AN INSTANCE OF AN OBJECT"
my code for SQL is
Imports System.Data
Imports System.Data.SqlClient
Dim conn1 As New SqlConnection("Server=ibmserver;database=Northwind;User id=ADMINISTRATOR;Password=ADMIN")
conn1.Open()
Dim ds1 As New DataSet
Dim str1 As String = "select * from_categories"
Dim str2 As String = "select * from products"
Dim adapter1 As New SqlDataAdapter(str1, conn1)
adapter1.Fill(ds1, "categories")
adapter1.SelectCommand = New SqlCommand(str2, conn1)
adapter1.Fill(ds1, "products")
ds1.Relations.Add("categories_products", ds1.Tables("categories").Columns("categoryID"), ds1.Tables("products").Columns("categoryid"))
Dim categories As DataTable = ds1.Tables("categories")
DataGrid1.DataSource = ds1.Tables("categories")
DataGrid1.DataBind()
DataGrid2.DataSource = ds1.Tables("categories.categories_products")
DataGrid2.DataBind()
******************************************************************************
my code for oracle is
imports system.data.oledb
dim myConn as OledbConnection
dim myDa as oledbDataAdapter
dim myDa1 as oledbDataAdapter
dim drowParent as datarow
dim drowchild as datarow
dstDT = new dataset()
myConn=New OleDbConnection("Provider=MSDAORA.1;User ID=jewellman;password=jewellman;Data Source=orcl;Persist Security Info=False")
myDa = new oledbdataadapter("Select * from designTransactions",myConn)
myConn.open()
myda.fill(dstDT,"designtransaction")
myDa.selectcommand=new oledbcommand("Select * from designcustomerapprovel",myconn)
myda.fill(dstDT,"designcustomerapprovel")
dstDt.relations.add("DesignApprovel",dstDT.tables("designtransactions").columns("id"),dstDt.Tables("designcustomerapprovel").columns("categoryid"))
myConn.close()
|
|
|
|
|
Hi
Cloud you tell me if is possible to add some text in some bottome and this text to be dinamic.I need to change text from xml but i am not sure that this is a good practic.How to put text exacly into botton???
good bye
|
|
|
|
|
If it is a server control then you set the text like this:
YourButtonName.Text = "whatever";
if it is a HTML input tag then you set the value attribute.
--------------------------------------------------------
My portfolio & development blog
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
But if i use imagine button???
|
|
|
|
|
Isn't it logical that you ahve to set a image then ?
--------------------------------------------------------
My portfolio & development blog
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
why i whant to change text by xml??
|
|
|
|
|
You have a image button FFS. What text are you trying to set if there is a image on the button?!?!
--------------------------------------------------------
My portfolio & development blog
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
Sir/Madam
I want to show system month and year in two dropdownlist box
Balwan Singh
|
|
|
|
|
And?
--------------------------------------------------------
My portfolio & development blog
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
I want to enabled/disabled dropdownlist on checked/unchecked of a checkbox in datagrid
but i want the above event to be done through javascript
Can anyone help me at the earliest.
|
|
|
|
|
Hi,
Below code solves your problem.
<script language='javascript'>
function newtest()
{
if(document.getElementById("CheckBox1").checked == true)
document.getElementById("DropDownList1").disabled = true;
else
document.getElementById("DropDownList1").disabled = false;
}
</script>
Add the below code inside checkbox tag..
OnClick="newtest()" 'removed' text has to be changed to 'onclick'
Hope this helps you...
|
|
|
|
|
|
Sir/Madam,
I want to select system month and year in dropdown list:
In detail i have two dropdownlist1, dropdownlist2 and 1st for months and second for years. it will automatically take month and year according to the system date. i have eneted items in months in character and year in numeric
Balwan Singh
|
|
|
|
|
Please do not double-post!
--------------------------------------------------------
My portfolio & development blog
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
I would like to bind the slides in powerpoint to my datagrid .what all I should do for this.
Manoj Kumar
Infonet technologies
Hyderabad
|
|
|
|
|
I am currently using visual studio 2005 and given the task to implement a user/role management wif asp.net and atlas reference to this url
http://livedemos.peterkellner.net/AJAXDemo/
anyone has any ida how i can start on this?
I downloaded MembershipEditorAtlas1.zip and used asp.net configuration to configure it.
But it keeps giving the error
The type specified in the TypeName property of ObjectDataSource 'ObjectDataSourceMembershipUser' could not be found.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Anyone has any idea... i really urgently need to get this to work... thanz
|
|
|
|
|
silverP wrote: The type specified in the TypeName property of ObjectDataSource 'ObjectDataSourceMembershipUser' could not be found.
There are a couple things which you might want to check:
+ Where is the type specified in the TypeName property defined? (In the App_Code folder or in a seperate assembly)
+ Check the assembly reference if any.
+ Check if the type name in the TypeName property is qualified or not?
|
|
|
|
|
Gave up on earlier post of using imageButtons and command arguements, but can't get the following to work either. When trying to delete a row, and using the SELECT rows, I get an error of the selected index out of range even though I'm asking it to select the record in the dataset based on a primary key field (the rows commented out). When using the FIND rows, it stops on the row.delete() line with an error of "Object reference not set to an instance of an object." Really frustrated and would appreciate some help.
<%@ Import Namespace="System.Data.SqlClient" %><br />
<%@ Import Namespace="System.Web.UI.WebControls" %><br />
<%@ Import Namespace="System.Data" %><br />
<%@Page Language="VB" debug="True"%><br />
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><br />
<script language="vb" runat="server"><br />
Public strConn As String = "user id=myUser;data source=serverName;persist security info=True;initial catalog=myDatabase;password=pwd;" <br />
Public cn As New SqlClient.SqlConnection(strConn)<br />
Public ds as New Dataset<br />
Public da as New SQLDataAdapter<br />
Public varID as integer, varUPD as integer, varPG as integer<br />
<br />
Sub Page_load(sender as Object, e as EventArgs)<br />
if request("upd")="" or request("upd")="0" then varUPD=0 else varUPD=int(request("upd"))<br />
if request("eventID")="" or request("eventID")="0" then varID=0 else varID=int(request("eventID"))<br />
if request("pageID")="" or request("pageID")="0" then varPG=0 else varPG=int(request("pageID"))<br />
eventID.text=varID<br />
<br />
da = New SqlDataAdapter("sp_eCoursePage", cn) <br />
da.SelectCommand.CommandType = CommandType.StoredProcedure <br />
Dim p_ID as New SqlParameter("@ID", varID) <br />
da.SelectCommand.Parameters.Add(p_ID) <br />
da.Fill(ds, "pages")<br />
Dim autogen As New SqlCommandBuilder(da)<br />
Dim dt As DataTable = ds.Tables("pages")<br />
<br />
select case varUPD<br />
case 1 ' Delete a record.<br />
dt.PrimaryKey = New DataColumn() {dt.Columns("pageID_pk")} 'used find<br />
Dim row As DataRow = dt.Rows.Find(varPG) 'used find<br />
row.Delete() 'used find<br />
'dim mySQL as string = "pageID_pk=" & varPG 'used select<br />
'Dim row As DataRow = dt.Select(mySQL)(0) 'used select<br />
'row.Delete() 'usedselect<br />
da.Update(ds, "pages")' Update the database.<br />
lblMsg.text=mySQL<br />
case 2<br />
dim myURL="adminEcourseUpdate.aspx?pageID=" & varPG<br />
response.redirect(myURL)<br />
end select<br />
<br />
If ds.Tables("pages").Rows.Count = 0 Then <br />
dgCourseList.visible=False<br />
else<br />
dgCourseList.DataSource = ds.tables("pages")<br />
dgCourseList.dataBind()<br />
dgCourseList.visible=True<br />
end if<br />
if Not Page.IsPostback then <br />
pageAdd.visible=False<br />
else<br />
pageAdd.visible=True<br />
end if<br />
cn.close<br />
'OnItemCommand="dgCourseListItemCommand" - for imageButtons that couldn't get to work<br />
end sub<br />
</script><br />
<br />
<asp:DataGrid id="dgCourseList" autogenerateColumns="False" runat="server" ><br />
<Columns><br />
<asp:BoundColumn DataField="pageID_pk" Visible="False"></asp:BoundColumn><br />
<asp:hyperlinkcolumn dataNavigateurlField="pageID_pk" dataNavigateUrlFormatString="adminECourse.aspx?upd=1&pageID={0}" text="Del"></asp:hyperlinkcolumn><br />
<asp:hyperlinkcolumn dataNavigateurlField="pageID_pk" dataNavigateUrlFormatString="adminECourse.aspx?upd=2&pageID={0}" text="Upd"></asp:hyperlinkcolumn><br />
</Columns><br />
blah, blah.....
|
|
|
|
|
I have two pages A and B.
ON page A, I have three drop down boxes ( month , year, and unit_abbr and they have cascading and Auto post backs) and click button to run a report. What I am trying to do is keeping selected drop down list values after the postbacks. The problem right now is when I come back to page A after I browse page B , the selected values in dropdown boxes are set back to the default ( in my case most recent month, year, unit_num). How can I keep the selected values inside of dropdown lists while I am browsing around different pages? If I select month = 1 year 2006 unit_abbr = D11 to run the report on page A, then go to the different page to browse around different report and when I come back to Page A, the selected parameters in those drop down lists should be set to month = 1 year 2006 unit_abbr = D11
Here is my code using session variable:
<asp:label id="Label4" runat="server" text="Select Year:" forecolor="Black" font-bold="True" font-names="Arial" font-size="8pt">
<asp:dropdownlist id="DropDownList2" runat="server" datasourceid="SqlDataSource3" datatextfield="year" datavaluefield="year" font-names="Tahoma" font-size="8pt" autopostback="True" onselectedindexchanged="DropDownList2_SelectedIndexChanged1">
<asp:label id="AccountStatus" runat="server" font-size="16pt" visible="False" width="87px">
<asp:label id="Label5" runat="server" text="Select Month:" forecolor="Black" font-bold="True" font-names="Arial" font-size="8pt">
<asp:dropdownlist id="DropDownList1" runat="server" datasourceid="SqlDataSource2" datatextfield="month" datavaluefield="month" font-names="Tahoma" font-size="8pt" onselectedindexchanged="DropDownList1_SelectedIndexChanged" autopostback="True">
<asp:label id="Label7" runat="server" text="Select Region:" forecolor="Black" font-bold="True" font-names="Arial" font-size="8pt">
<asp:dropdownlist id="DropDownList4" runat="server" autopostback="True" datasourceid="SqlDataSource6" datatextfield="region_name" datavaluefield="Region_num" font-names="Tahoma" font-size="8pt" onselectedindexchanged="DropDownList4_SelectedIndexChanged">
--Here is code behind
public
partial class Dashboard : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack && ((this.Session["MMselectedvalue"] != null) && (this.Session["YYselectedvalue"] != null)
if (!Page.IsPostBack && ((this.Session["MMselectedvalue"] != null) && (this.Session["YYselectedvalue"] != null) && (this.Session["Unitselectedvalue"]) != null) && (this.Session["Regionselectedvalue"] != null))
{
this.DropDownList1.SelectedIndex = Convert.ToInt32(this.Session["MMselectedvalue"]);
this.DropDownList2.SelectedIndex = Convert.ToInt32(this.Session["YYselectedvalue"]);
this.DropDownList3.SelectedIndex = Convert.ToInt32(this.Session["Unitselectedvalue"]);
this.DropDownList4.SelectedIndex = Convert.ToInt32(this.Session["Regionselectedvalue"]);
GridView4.DataBind();
}
protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
{
this.Session["MMselectedvalue"] = this.DropDownList1.SelectedIndex;
}
protected void DropDownList2_SelectedIndexChanged(object sender, EventArgs e)
{
this.Session["YYselectedvalue"] = this.DropDownList2.SelectedIndex;
}
protected void DropDownList3_SelectedIndexChanged(object sender, EventArgs e)
{
this.Session["Unitselectedvalue"] = this.DropDownList3.SelectedIndex;
protected void DropDownList4_SelectedIndexChanged(object sender, EventArgs e)
{
this.Session["Regionselectedvalue"] = this.DropDownList4.SelectedIndex;
But, the problem is the data controls of drop downboxe ( sql datasource) are overwriting the session varialbles, so it set back to the default value...
How can I keep the session variables after the data binding ( sql datasource for drop downboxes)? ,and How can I ditermine whether it's just a postback ( changing selected values on the same page) or the user is actually changing the page( navigate different pages and come back to the same page).?
|
|
|
|
|
In the selectedIndexChange event handler add the selected index to a session.
Then in page_load you check for a postback (you do nothing). If there is no postback you check the session if it contains those stored indexes and if it does you fill the drop downs with data and then select the one that is in the session.
--------------------------------------------------------
My portfolio & development blog
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
You may also need to set the selected indexes from session after the ddls are databound.
|
|
|
|
|
How can I do that? Can you provide me some code examples?
|
|
|
|
|
Thanks, I think I almost figured it out.. except the dropdownlist3 is still set back to the default value ( doesn't remember previous selected value). Is it because the dropdownbox3 is populated by the drop down box4 ( cascading dropdown box)? How can I work around this?
--Here is the code for dropdownbox3
<asp:dropdownlist id="DropDownList3" runat="server" datasourceid="SqlDataSource4" datatextfield="unitname_abbr" datavaluefield="unit_abbr" width="352px" font-names="Tahoma" font-size="8pt" onselectedindexchanged="DropDownList3_SelectedIndexChanged" autopostback="True">
<asp:sqldatasource id="SqlDataSource4" runat="server" connectionstring="<%$ ConnectionStrings:Finance_AppsConnectionString %>" selectcommand="
select distinct(unit_name) as unit_name,unit_abbr
, ( convert(varchar(5), unit_abbr) + ' - ' + convert(varchar(50), unit_name))as unitname_abbr
from revenue_aggregate
where region_num = @region_num
group by unit_name, unit_abbr
order by unit_abbr">
<selectparameters>
<asp:controlparameter controlid="DropDownList4" name="region_num" propertyname="SelectedValue">
--------------------------------------------------Updted code
if (!Page.IsPostBack)
{
try
{
this.DropDownList1.SelectedIndex = Convert.ToInt32(this.Session["MMselectedvalue"]);
this.DropDownList2.SelectedIndex = Convert.ToInt32(this.Session["YYselectedvalue"]);
this.DropDownList3.SelectedIndex = Convert.ToInt32(this.Session["Unitselectedvalue"]);
this.DropDownList4.SelectedIndex = Convert.ToInt32(this.Session["Regionselectedvalue"]);
}
catch
{
}
}
else
{
}
|
|
|
|