|
Hi All,
I am using C# , asp.net2.0 , Ajax1.0
i am filling dropdownlist using cascading ajax extender. i taken help of ajax site and build a code to fill the control.
my question is how do i get parent selected item value. my web service code to fill target value
<code> public CascadingDropDownNameValue[] GetProd(string knownCategoryValues , string category)
{
StringDictionary kv = CascadingDropDown.ParseKnownCategoryValuesString(knownCategoryValues);
//string subgrp ;
//int sub1;
//if (!kv.ContainsKey("Prod") || !Int32.TryParse(kv["Prod"], out sub1))
//// if (!kv.ContainsKey("Prod"))
//{
// return null;
//}
DsprdTableAdapters.SPGETPRODUCT_GIVENSUBTableAdapter prd = new DsprdTableAdapters.SPGETPRODUCT_GIVENSUBTableAdapter();
Dsprd.SPGETPRODUCT_GIVENSUBDataTable prdgrp = prd.GetProd(kv["Prod"]);
List<CascadingDropDownNameValue> values = new List<CascadingDropDownNameValue>();
foreach (DataRow dr in prdgrp)
{
values.Add(new CascadingDropDownNameValue((string)dr["PM_PRD_NAME"], dr["PM_PRD_CODE"].ToString()));
}
return values.ToArray();
}
</code>
This is giving me no out put as kv["Prod"] is showing null value.
Cascading code in aspx is
<code><ajaxToolkit:CascadingDropDown ID="cddPROD"
runat="server"
TargetControlID="Ddlproduct"
ParentControlID="Ddlsubdiv"
Category="Prod"
PromptText="Choose a Product...."
LoadingText="Please wait ..."
ServicePath="../Prod.asmx"
ServiceMethod="GetProd" />
Please Suggest
</code>
regards
imran khan
|
|
|
|
|
The GridView in question is displaying data correctly.
However, when I pass some of them by using dynamic links on the GridView, they showup as empty strings. Here's my code:
<br />
protected void gvStatus_RowDataBound(object sender, GridViewRowEventArgs e)<br />
{<br />
string fName,stnID,submitBy;<br />
if (e.Row.RowType == DataControlRowType.DataRow)<br />
{<br />
fName = Convert.ToString((gvStatus.DataKeys[e.Row.RowIndex].Values["FILE_NAME"]));<br />
stnID = Convert.ToString((gvStatus.DataKeys[e.Row.RowIndex].Values["STATION_ID"]));<br />
submitBy = Convert.ToString((gvStatus.DataKeys[e.Row.RowIndex].Values["SUBMITTEDBY"]));<br />
LinkButton url = (LinkButton)e.Row.FindControl("lnkAction");<br />
url.PostBackUrl = "statdetails.aspx" + "?File=" + fName.ToString() + "&Station="<br />
+ stnID.ToString() + "&SubmittedBy=" + submitBy; <br />
}<br />
}<br />
I get => "...statdetails.aspx?File=&Station=&SubmittedBy="
I checked the strings and they are empty.
So, data is on the GridView from the same query, but when I try to get them from there, looks like something going wrong.
Any idea?
Thanks.
Ekjon
|
|
|
|
|
You can use datarowview instead
Dim R as datarowview = e.row.dataitem
fName = Convert.ToString((r.item["FILE_NAME"]));
stnID = Convert.ToString((r.item["STATION_ID"]));
submitBy = Convert.ToString((r.item["SUBMITTEDBY"]));
Alexei Rodriguez
|
|
|
|
|
Hi, i'm used Visual Studio 2008 Pro to create and publish
my website. Everything seemed to be successful but when
i tried to go to the page online i get this error:
Runtime Error
Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.
Details: To enable the details of this specific error message to be viewable on remote machines, please create a <customerrors> tag within a "web.config" configuration file located in the root directory of the current web application. This <customerrors> tag should then have its "mode" attribute set to "Off".
It works fine in my virtual directory but not the server.
This is for a class and your help is greatly appreciated!!
Phivos
|
|
|
|
|
You need to disable custom errors to view the actual error message.
Follow the instructions provided to you in the error message to do this.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
Hello Friend,
Follow Below Steps To solve This Problem(It has been tested on Visual Studio 2005)
1)Check your DataBase Connection has properly configured in webconfig .
2)Check the server system for IIS (inetpub) . If not Load it.
3)In Visual Studio -> go to command prompt there type aspnet_regiis -i. (Command Editor Of IIS)
4)close all application and restart your visual studio and check..
5)ping for ip address of server machine .
6) e.g (xx.xxx.xxx.xxx/ProjectName/EgPage.aspx.
7) Any problem Contact i will do my best.
ArunVijay
|
|
|
|
|
Hello Friend,
Follow Below Steps To solve This Problem(It has been tested on Visual Studio 2005)
1)Check your DataBase Connection has properly configured in webconfig .
2)Check the server system for IIS (inetpub) . If not Load it.
3)In Visual Studio -> go to command prompt there type aspnet_regiis -i. (Command Editor Of IIS)
4)close all application and restart your visual studio and check..
5)ping for ip address of server machine .
6) e.g (xx.xxx.xxx.xxx/ProjectName/EgPage.aspx.
7) Any problem Contact i will do my best.
ArunVijay
|
|
|
|
|
Thanks for your reply,
I realized after removing those lines from the web.config that new ones errors
come up and they seem to be similar. It cannot load the following files or assemblies:
<add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089">
<add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089">
<add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089">
<add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
I also tried removing them and then adding the references again!
any ideas?
Thanks!
|
|
|
|
|
Thanks for your reply,
I realized after removing those lines from the web.config that new ones errors
come up and they seem to be similar. It cannot load the following files or assemblies:
add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"
add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"
add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"
add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
I also tried removing them and then adding the references again!
any ideas?
Thanks!
|
|
|
|
|
VS2005
I'm working on a web site that is working on the server on which it resides. It is completely undocumented, and has very few actual comments. I have not yet modified any of the code. However, when I try to run the site, I get the following:
<%@ Master Language="C#" EnableTheming="false" AutoEventWireup="true" CodeFile="mp_Main.master.cs" Inherits="mp_Main" %>
The error I'm getting is: "Master" is not a valid attribute of element "Page". Keep in mind that the line of code above is the very first thing in the file.
Secondly, the compiler is telling me it can't find a file, yet the file exists just plain as day.
WTF is going on here?
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
mine reads:
<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="SlaSyConOSNL.master.cs" Inherits="SlaSyConOSNL.SlaSyConOSNL" %>
|
|
|
|
|
I am using Asp.Net 2.0 (c#) and SQL2005.
I have a simple table with following info:
Column 1: bigint - unique id count field
Column 2: varchar - name of organisation
Column 3: DataTime - date record added
I basically need to show those records that are still valid. By valid i mean those records which have have an input date (column 3) of upto 2 years ago. Once the input DateTime is more than 2 years ago the record should no longer be shown.
Please can you give me help / ideas / info on how i can acheive this.
Many many thanks in advance!
|
|
|
|
|
In T-SQL this is one of the possibilities:
declare @date as varchar(15) <br />
set @date = '2008-04-15'
select * from myTable where Datetime >= convert(varchar(15),cast(@date as datetime),102)<br />
and datetime<= convert(varchar(15),(cast(@date as datetime)-365*2),102)
instead format date 102 use ur according format
Hope it helps...
I Love T-SQL
modified on Tuesday, April 15, 2008 7:20 PM
|
|
|
|
|
Thanks for the help!!!!!
However my SQL knowledge is limited, and i dont know what you mean about '102 date format'.
My dates arebeing stored in the format: '15/04/2008 00:00:00' eg Month/Day/Year.
Which code do i use for this?
Thanks again.
|
|
|
|
|
The 102 datetime format gives u this format yyyy.MM.dd
Try to run that code on Query Analyzer and see if it is according to your need, if not then fell free to ask
I Love T-SQL
|
|
|
|
|
Hi,
Ive tried running it and im getting absolutely nothing back. Ive updated the SQL as such for my table/data:
declare @date as varchar(15)
set @date = '2008-04-16'
select * from tbl_QualityStandard where qs_Start >= convert(varchar(15),cast(@date as datetime),102)
and qs_Start <= convert(varchar(15),(cast(@date as datetime)-365*2),102)
|
|
|
|
|
do u have recoreded data in qs_Start column:
qs_Start<br />
2008-04-16<br />
2008-04-15<br />
2008-04-14<br />
2008-04-13
or
qs_Start<br />
2008.04.16<br />
2008.04.15<br />
2008.04.14<br />
2008.04.13
or write me how u have inserted data in qs_start column
I Love T-SQL
|
|
|
|
|
Hi,
My date format is:
15/04/2008 eg day/month/year
|
|
|
|
|
try this
declare @date as varchar(15)<br />
set @date = '2008-04-16'<br />
select * from tbl_QualityStandard where qs_Start >= convert(varchar(15),cast(@date as datetime),103)<br />
and qs_Start <= convert(varchar(15),(cast(@date as datetime)-365*2),103)
I Love T-SQL
|
|
|
|
|
I do transaction in the business layer, and I use EntLib's DAAB.
This gives me some problems, namely a InvalidOperationException: "ExecuteNonQuery requires an open and available Connection. The connection's current state is closed."
I've tried both using the TransactionScope, and the ServiceConfig way of doing COM+ transactions.
It works fine without the transaction stuff.
I'm well aware that the connection gets closed since I do transaction from the business layer, but that should be possible, even if it then becomes a distributed transaction.
As I mentioned I'm also using the Enterprise Library Data Access Application Block, and Im'm wondering if that's what screwing things up.
Any good advice?
"When you have made evil the means of survival, do not expect men to remain good. Do not expect them to stay moral and lose their lives for the purpose of becoming the fodder of the immoral. Do not expect them to produce, when production is punished and looting rewarded. Do not ask, `Who is destroying the world?' You are."
-Atlas Shrugged, Ayn Rand
|
|
|
|
|
I solved it! After a days worth of hair-pulling
Apparently, DAAB v 3.1 closes the connection so you don't have to, and when I did so explicitly it got messed up.
I guess it's just a good case of "you create it - you close it".
"When you have made evil the means of survival, do not expect men to remain good. Do not expect them to stay moral and lose their lives for the purpose of becoming the fodder of the immoral. Do not expect them to produce, when production is punished and looting rewarded. Do not ask, `Who is destroying the world?' You are."
-Atlas Shrugged, Ayn Rand
|
|
|
|
|
I have dynamic links in a GridView. When the LinkButton Text has certain value e.g. "None", I want to disable them. Initial display is right - as Im using this code in the Page_Load:
for (int i = 0; i < gvStatus.Rows.Count; i++)<br />
{<br />
lb = (LinkButton)gvStatus.Rows[i].FindControl("lnkAction");<br />
if (lb.Text == "None")<br />
{<br />
lb.Enabled = false;<br />
}<br />
}<br />
When the GridView PageIndex changes though, the links show up as Enabled, So I put the same code in the Page_Load's if(Page.IsPostBack) and also GridView's OnPageIndexChanged event handler, still does the same.
I believe, part of the problem is, I am using AJAX UpdatePanel.
Any ideas?
Thanks
|
|
|
|
|
I got it done by using the code in the RowDataBound event handler.
Thanks.
Ekjon
|
|
|
|
|
It is the only place to do such actions.
|
|
|
|
|
Hello All,
A confusing issue (for me anyway) came up while trying to utilize a GridView on a page. I have a drop down list that contains a value that is used to perform a stored procedure via my SQL DataSource and then bind the results to my GridView. Slick as can be with hardly no coding as you all know.
Here is the issue though, I am trying to display a count of the results on the same page but for some reason, I get the previous page count. For example, on the first page load there are 5 results, the label displays 5. If I select another option from the dropdown and I know there will be no results, the label still displays 5, but if I select another option where there are results, the label displays 0. How is it that I am getting the previous count and not the current count?
So, my question is, how do I get the current count on each submission? Thank you in advance for any offers of help.
|
|
|
|
|