Showing posts with label hii. Show all posts
Showing posts with label hii. Show all posts

Monday, March 26, 2012

centered update progress

Hi;

I usually have my update progress control on the top of the page but on long pages, the user can't see it.

On codeplex.com, when i insert some text on "Search Projects" (upper right) and hit the search button, an "Updating" message is showed on the center of the page and the rest of the page becomes gray. Can i get this same result using AJAX update progress?

Thanks in advance;

If that is what you want, you should probably use the ModalPopup control. Try it at: http://asp.net/AJAX/Control-Toolkit/Live/ModalPopup/ModalPopup.aspx


Pls checkout this link, it got some cool example of Moal Popup extenderhttp://mattberseth.com/blog/modalpopupextender


See this link for AJAX Progress bar in the middle of page

http://www.ajaxium.com/ajax-for-asp.net.aspx

Cascasding Drop Down Page method custom variable

Hi

I have page method populating the first of my drop downs and the reason being is that i need a variable that will be specific to user.
Currently this is stored in the session...How can i use this variable in the Page Method that is static...I cant really use a static variable as they are shared between all users.

Thanks.

Steve

Hi Steve,

Unfortunately I don't know of a good way to do this anymore. When we first wrote CascadingDropDown page methods weren't required to be static so there was an easy solution. Could you create a work item on CodePlex for this? Perhaps we could modify the web service signature to include optional tag info.

Thanks,
Ted

AAAAAHHHHH!!!!!

Well i have found a solution that works for me and may well for others.....
I have a web method that has Sessions enabled that i can call to get the value from...of course this method cannot be on the page as Sessions arent static.

[

WebMethod(EnableSession =true)]
publicCascadingDropDownNameValue[] GetDivisionsBySessionIdAccount(string knownCategoryValues,string category)
{
SessionCollection oSC; if (Session["UserObj"] !=null) {
oSC = (SessionCollection)Session["UserObj"];
// Calling another method to get my array - the same one i used from the page method.
CascadingDropDownNameValue[] retArray = GetDivisionsByIdAccount(oSC.idAccount);
return retArray;
}
else {
thrownewException("Your Session Has Expired");
}
}

I have created a work item number7579 for this.

---

I have just updated to the release toolkit and now my CCDD have stopped working! The top drop down loads fine from the method above but none of the others below. I have a debug error in jsSys.Debug is null or not an object.??

ARGH!


Here's more on the typical cause of Sys.Debug is null:http://forums.asp.net/thread/1546990.aspx

Cascasding drop down - Error 500

Hi
I am playing with the cascading drop down control...
i have written a method to get data from sql 05 database and return andarray of CascadingDropDownNameValue. (i watched one of the how towebcasts on it)....anyway, i can get it to work else where but forsome reason its not working with this one.
I know the method is returning the right data as i have another methodwhich returns all values in a string[] i then dump on the screen andall is ok.
My CCD declaration.

<atlasT:CascadingDropDownID="CascadingDropDown1"runat="server">

<atlasT:CascadingDropDownProperties

Category="CategoryName"

ParentControlID="ddlClass"

TargetControlID="ddlCourses"

PromptText="All"ServiceMethod="GetCoursesByIdClass"

ServicePath="webservices/FillDropDowns.asmx"/>

</atlasT:CascadingDropDown>

My method...

[WebMethod]

publicCascadingDropDownNameValue[] GetCoursesByIdClass(string knownCategoryValues,string category)

{

// Get connection string from web.config

string dsn = System.Configuration.ConfigurationManager.ConnectionStrings["connCleo"].ConnectionString;

string[] categoryValues = knownCategoryValues.Split(':',';');

int idClass =Convert.ToInt32(categoryValues[1]);

// SQL script

string sql =@dotnet.itags.org."SELECT c.idCourse, c.chrName FROM cleo.Course c

JOIN cleo.CourseAssign ca ONca.idCourse=c.idCourse

WHERE idClass=@dotnet.itags.org.idClass

ORDER BY c.chrName";

// Generic list for collection

List<CascadingDropDownNameValue> cascadeCollection =newList<CascadingDropDownNameValue>();

// Open connection and execute command...loop through reader and add items to list.

using(SqlConnection conn =newSqlConnection(dsn))

using (SqlCommand cmd =newSqlCommand(sql, conn))

{

cmd.Parameters.AddWithValue("@dotnet.itags.org.idClass", idClass);

conn.Open();

using (SqlDataReader reader = cmd.ExecuteReader())

{

while (reader.Read())

{

cascadeCollection.Add(newCascadingDropDownNameValue(reader.GetString(1), reader[0].ToString()));

}

}

}

// return collection as an array.

return cascadeCollection.ToArray();

}


I dont know of anyway i can debugthis to see if i am infact getting the correct values back(not surewhat values i need to pass to the method to mimic the call from thetoolkit.)?

Hopefully someone can see where i am going wrong.??

Thanks
Steve

OK, so i am pulling my hair out and have no idea where to look for help other than here.

I have put the same code in another project and it works fine.

The only difference that i can see is the version of the Atlas and Toolkit dll.

The date stamp on the one that works is 04/05/2006
The one that doesnt work is 27/06/2006

So begs the question....what has changed in the June CTP that stops my service from working?

Any ideas?
Steve


Again...the brick wall.
I added in the new CTP dll's to my project that works and it still works.

If i add the old dll's into my not working project...i dont get error 500, but i do get a popup error when trying to change the selection of parent ddl...(eventvalidation error) and no, nothing is bound to the Drop down.

:-(

Steve


sorted it!!!!

I was missing stuff from the web.config file !!!

Well thats two hours of my life gone!!!

Steve


OK...new error now. i seem to be speaking to myself here but if anyone does join in maybe they can help.

The drop down is not binding fine...problem is when i try and postback (with button) i get a postback validation error (there are a few posts on here with no clear answer, none regarding the CDD control though)...anyway, so i turn of validation and the value in the second drop down list has nothing...it should be an number (as id for the text on display...nothing odd there).

I have tried

protectedoverridevoid Render(HtmlTextWriter writer)
{
ClientScript.RegisterForEventValidation(this.UniqueID);
base.Render(writer);
}

but this has no affect.

Steve


i was a touch hasty with my previous post...there is a value in the selectedvalue property....however i was checked that selectedindex > 0...even though it was, it wasnt (if that makes sense - the debugger says 0)...however i got round this withstring.IsNullOrEmpty(ddl.SelectedValue)

But now i have to have eventvalidation off.

What are the implications of this...surely this isnt correct? I must be able to have it turned on...not sure what i does but feel like i'm missing out!!!!!!

Anybody?

Steve


Seee http://forums.asp.net/thread/1293293.aspx #20

Event Validation just makes sure the values you posted from your dropdown are valid values you populated it with. But seeing as the cascading dropdown populates from script, this wont/cant work and if you need to, validate the values on the server (its a security thing)

Saturday, March 24, 2012

CascadingDropDown setting SelectedValue programmatically doesnt work

Hi

I have a page which has four dropdowns "linked" together via CascadingDropDown Extenders.

The page works fine, except that I sometimes want the dropdowns to be pre-populated and specific items selected programmatically.

e.g.

1cddlMakes.SelectedValue = cmk.Vehicle.Make.ID2cddlModels.SelectedValue = cmk.Vehicle.Model.ID3cddlTypes.SelectedValue = cmk.Vehicle.Type.ID4cddlEngines.SelectedValue = cmk.Vehicle.Engine.ID

The first 2 dropdowns load and display the correct selected value, but the other two dropdowns SelectedValues don't get set and stay on the "Please Select..." option.

Any ideas?

Using the sample page, I have no issue programmatically setting any of the 3 cascading drop down extenders' selected value. Are you setting the extenders or the controls?
12 CascadingDropDown1.SelectedValue ="Acura";3 CascadingDropDown2.SelectedValue ="Integra";4 CascadingDropDown3.SelectedValue ="Green";

Wednesday, March 21, 2012

CascadingDropDown Sample problem, Method Error 500

Hi

I've downloaded the last version of Control Toolkit and I've installed it. When I try to run the WebSampleSite, everything works fine except CascadingDropDown, The first combo says "Method Error 500". Any ideas?

Please help...

to me Method Error 500 is webservices error

try look webservices area..make sure it gets call (you can debug into it)

CascadingDropDown not populating

Hi

I'm trying to use the CascadingDropDown with a database in VB, using page methods.

My three DropDownLists are drpProject, drpFixFor and drpFixForSub. The drpProject control is populated fine when the page loads; and I'd expect the drpFixFor control to be populated when drpProject is changed, however, this is not happening.

The drpFixFor control is being enabled, but not populated - my "GetFixForList" function doesn't appear to be calledat all. (I put a breakpoint in it, and the breakpoint isn't hit.)

Interestingly, if I remove ParentControlID="drpProject" from drpFixFor's extender, the function is called as expected when the page loads.

My aspx page is:

<%

@dotnet.itags.org.PageLanguage="VB"MasterPageFile="~/MasterPage.master"AutoEventWireup="false"CodeFile="Test.aspx.vb"Inherits="Test"Title="" %>

<%

@dotnet.itags.org.RegisterAssembly="AtlasControlToolkit"Namespace="AtlasControlToolkit"TagPrefix="atlasToolkit" %>

<

asp:ContentID="Content1"ContentPlaceHolderID="cphBody"runat="Server">
<table> <tr> <tdstyle="width: 100px">Project:</td> <td><asp:DropDownListID="drpProject"runat="server"/></td> </tr> <tr> <tdstyle="width: 100px">Fix For:</td> <td><asp:DropDownListID="drpFixFor"runat="server"/></td> </tr> <tr> <tdstyle="width: 100px">Fix For Sub:</td> <td><asp:DropDownListID="drpFixForSub"runat="server"/></td> </tr></table><atlasToolkit:CascadingDropDownID="CascadingDropDown1"runat="server"> <atlasToolkit:CascadingDropDownPropertiesTargetControlID="drpProject"Category="Project"PromptText="(Select One)" ServiceMethod="GetProjectList"/> <atlasToolkit:CascadingDropDownPropertiesTargetControlID="drpFixFor"Category="FixFor"PromptText="(Select One)"ParentControlID="drpProject"ServiceMethod="GetFixForList"/> <atlasToolkit:CascadingDropDownPropertiesTargetControlID="drpFixForSub"Category="FixForSub"PromptText="(Select One)"ParentControlID="drpFixFor"ServiceMethod="GetFixForSubList"/></atlasToolkit:CascadingDropDown>

</

asp:Content>

And my Code Behind page is:

Imports

AtlasControlToolkit

Imports

System.Web.Services

Partial

Class Test Inherits System.Web.UI.Page

<WebMethod()> _

PublicFunction GetProjectList(ByVal knownCategoryValuesAsString,ByVal categoryAsString)As CascadingDropDownNameValue() Dim valuesAsNew Generic.List(Of CascadingDropDownNameValue) ForEach myProjectAs ProjectIn Project.GetList

values.Add(

New CascadingDropDownNameValue(myProject.Name, myProject.ID)) Next Return values.ToArray EndFunction

<WebMethod()> _

PublicFunction GetFixForList(ByVal knownCategoryValuesAsString,ByVal categoryAsString)As CascadingDropDownNameValue() Dim valuesAsNew Generic.List(Of CascadingDropDownNameValue) ' Hardcode to Project "2" for debugging ForEach myFixForAs FixForIn FixFor.GetList(2)

values.Add(

New CascadingDropDownNameValue(myFixFor.Name, myFixFor.ID)) Next Return values.ToArray EndFunction

End

Class

Note: "Project" and "FixFor" are objects defined in my App_Code folder, and their "GetList" functions return data from the SQL database.

Any ideas?

Thanks,
Andrew

I am also facing some issues with the cascadingdropdown extender, my question is that what if my database schema is such that i dont have ID for the fields in the drop downs, cant i fetch the value in the second drop down with the string value in the first drop down. As i understand this, ID seems to be added mandatorily in this extender.

-Pratibha


I don't see anything wrong with your code - what happens if you change all three service method's to call the one that's workng? Does it get called then?

Pratibha - I don't understand your question. ID isn't added by the extender at all - you can put whatever you want into the value field of the CascadingDropDownNameValue.


hey shawn, now i get it..hadnt looked carefully through the tool kit code earlier. It makes sense now and the cascadingdropdown works perfectly :)
Cool!

Hi

I've tried setting all three service methods to call GetProjectList, and still no luck - the function's called once when the page is loaded to populate the first DropDown, and not called for the others.

Thanks,
Andrew


To fix this, you need to add EnableEventValidation="false" to your Page directive. This should be a FAQ for CascadingDropDown, but basically ASP.NET tries to make sure that postbacks don't contain stuff they shouldn't based on what it knows about the page it sent down. Well, CDD is all about sending back data that wasn't in the page to begin with, so this feature needs to be disabled for pages that use it.

That's the good news. :) The bad news (or better news depending on how you see it) is that this should have been easier to debug. CDD tries to populate the list with error details when an error occurs (see _onMethodError), but it doesn't because a change some time ago to use name/value pairs for the data type wasn't applied to the error methods. I've logged this for fixing in the next release.

But for now, your issue should be trivially solvable by flipping EnableEventValidation as I note above.

Thanks!


Fantastic - that did the job!

Thanks
Andrew


nice1 David,

that had really thrown me, thought it was a vb.net thing. the debugging experience on this could definitely be improved on but at least it's in the forums.

thanks

I've been trying to get this example to work so as I can use similar in my own pet project.

Would anyone be kind enough to tell\show me how to create the "Projects" and "FixFor" objects which are defined in the App_Code folder.

I'm getting errors on this line

ForEach myProjectAs ProjectIn Project.GetData

How do I define Project in the TableAdapter?

Rgds

DOShea


Hi,

My parent dropdown itself is not population. I addedEnableEventValidation="false" in page tag. Still no luck.

If i work in " atlas web project", I am able sccess with cascading dropdown. But if i try to do with existing project, i am not able to. No error but first dropdown itself not populating.

I added in web.config

<

pages>

<

controls>

<

addnamespace="Microsoft.Web.UI"assembly="Microsoft.Web.Atlas"tagPrefix="atlas"/>

<

addnamespace="Microsoft.Web.UI.Controls"assembly="Microsoft.Web.Atlas"tagPrefix="atlas"/>

</

controls>

...

</

pages>

This is my aspx page code:

<%

@.PageLanguage="VB"AutoEventWireup="true"CodeFile="Default.aspx.vb"Inherits="_Default"EnableEventValidation="false" %>

<%

@.RegisterAssembly="AtlasControlToolkit"Namespace="AtlasControlToolkit"TagPrefix="atlasToolkit" %>
<formid="form1"runat="server"><atlas:ScriptManagerID="ScriptManager1"runat="server"/><div><asp:DropDownListID="DropDownList1"runat="server"></asp:DropDownList><asp:DropDownListID="DropDownList2"runat="server"></asp:DropDownList></div><atlasToolkit:CascadingDropDownID="CascadingDropDown1"runat="server"><atlasToolkit:CascadingDropDownPropertiesTargetControlID="DropDownList1"Category="Make"PromptText="Please select a make"ServiceMethod="GetDropDownContentsPageMethod"/><atlasToolkit:CascadingDropDownPropertiesTargetControlID="DropDownList2"Category="Model"PromptText="Please select a model"ServicePath="CarService.asmx"ServiceMethod="GetProductGroups"ParentControlID="DropDownList1"/></atlasToolkit:CascadingDropDown></form>

.Vb File:

<WebMethod()> _

PublicFunction GetDropDownContentsPageMethod(ByVal knownCategoryValuesAsString,ByVal categoryAsString)As CascadingDropDownNameValue()

Dim valuesAs List(Of CascadingDropDownNameValue) =New List(Of CascadingDropDownNameValue)

values.Add(

New CascadingDropDownNameValue("A","1"))

values.Add(

New CascadingDropDownNameValue("B","2"))

values.Add(

New CascadingDropDownNameValue("C","3"))Return values.ToArrayEndFunction

My WebService (CarService.vb):

<WebMethod()> _

PublicFunction GetProductGroups(ByVal knownCategoryValuesAsString,ByVal categoryAsString)As CascadingDropDownNameValue()Dim kvAs StringDictionary = CascadingDropDown.ParseKnownCategoryValuesString(knownCategoryValues)Dim valuesAs List(Of CascadingDropDownNameValue) =New List(Of CascadingDropDownNameValue)Dim ProvinceIdAsIntegerIf (kv.ContainsKey("Make")And Int32.TryParse(kv("Make"), ProvinceId))ThenIf ProvinceId = 1Then

values.Add(

New CascadingDropDownNameValue("a","1"))ElseIf ProvinceId = 2Then

values.Add(

New CascadingDropDownNameValue("b","1"))EndIfEndIfReturn values.ToArrayEndFunction

Any help is highlyAppreciated.

Regards

kant.


My reply from the private email about this issue:

"The web.config for an Atlas has additional settings that aren't present in a default web.config. It sounds like you need to add one or more of those settings to your site's web.config. You might find the windiff utility helpful in identifying the changes. Hope this helps!"


Thanks David. I am able to solve by adding aditional attributes.

I have another prob with in the same page. I added a gridview to that page having Edit & Delete buttons.

When ever my page is postback(by clicking button or by grid events ) , it's refreshing twice. Any Idea?

I am usingCollapsiblePanel, CascadingDropDownin that page.

kindly reply me if you come across this probulem.

Regards

Kant.


Hi,

This is my scenario.

In production server (win2003 with IIS 6.0, asp.net 2.0 and asp.net 1.1 coexist),
My drop downs appear blank if I try to use web services to provide the data.
If I use built in page methods and I got 'sys' is undefined.

In development pc, (XP with IIS 5.1, asp.net 2.0 and asp.net 1.1 coexist),
Both web services and page methods work without any problem.

Web.config in both machine were identical.

Does anyone have any idea why?

Thanks in advance.

Michael


"Sys undefined" suggests that Atlas itself may not be installed/configured correctly on that server.