|
I'm glad I helped. ASP.NET AJAX is easy, b/c you get given a black box. But, it's good to understand what AJAX is, and what it's doing, so you understand the performance impact of using it, especially as the MS library is not very efficient. That's assuming you have a site under some sort of load, if you only have a couple of users, it probably doesn't matter.
ASP.NET isn't too hard, the stateless paradigm is the main thing to get a handle on, and the fact that any events that you fire, fire between page load and page prerender, the other trap is to do stuff in page load, such as databinding, and then find you press a button, and the change is not visible ( b/c you bound to data BEFORE the event fired )
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
I am binding the same gridview to excel or text data based on user selection, and passing the dataview in session to different page for further analysis. It works fine when the user selects excel data; but in case user selects text data, it shows Null Reference exception in another page. Code is as follows:
protected void Button_view_click( object sender, Eventargs e)
{
if(....=="Excel")
{
BindExcel();
}
else(.... == "text")
{
BindTExt();
}
GridView1.EnableViewState = true;
dv = GridView1.DataSource as DataView;
Session["DataViewExcel"] = dv;
}
In anothere page, i am using following code :
Private void PageLoad()
{
DataView dv1 = new DataView();
DataTable dt1 = new DataTable();
dv1 = Session["DataViewExcel"] as DataView;
dt1 = dv1.ToTable(); // Exception occurs here, only in case of text data
}
Stack Trace is as follows :
Stack Trace:
[NullReferenceException: Object reference not set to an instance of an object.]
PreThesisSoftware.DiscreteDistribution.Page_Load(Object sender, EventArgs e) in C:\Users\Ashutosh\Documents\Visual Studio 2008\Projects\UploadFile\PreThesisSoftware\PreThesisSoftware\DiscreteDistribution.aspx.cs:23
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
System.Web.UI.Control.OnLoad(EventArgs e) +99
System.Web.UI.Control.LoadRecursive() +50
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627
|
|
|
|
|
And which line is line 23 ? Have you used the debugger to step through this code ? What have you done to diagnose the problem ?
The error means what it says, you're using an uninitialised object somewhere. Probably dv1 = Session["DataViewExcel"] as DataView;. The reason to use 'as' is that if the cast is not valid, you get null back. Using 'as' and not checking the return for null, is bad programming.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
if(Session["DataViewExcel"] !=null){
}
living none stoping.
|
|
|
|
|
I am attempting to populate a ListBox with the names of users that belong to an AD Distribution List. This was working previously, but the scope of the site has changed and I now need to include multiple groups in this List Box. I put the three groups into a new group, and changed my code to pull the members of that group. The list box is now populated with the three subgroups instead of the members of each group.
Here is the code I am using:
Dim Groups As New DirectorySearcher
Dim GroupSearchRoot As New DirectoryEntry("LDAP://OU=Something,OU=Something,OU=Something,DC=Something,DC=Something")
With Groups
.SearchRoot = GroupSearchRoot
.Filter = "(&(ObjectClass=Group)(CN=SomeGroup))"
End With
Dim Members As Object = Groups.FindOne.GetDirectoryEntry.Invoke("Members", Nothing)
For Each Member As Object In CType(Members, IEnumerable)
Dim CurrentMember As New DirectoryEntry(Member)
AuthMan.Items.Add(CurrentMember.Name.Remove(0, 3))
There is probably a very simple way to do this I am sure, but I am not thinking of it or finding it anywhere.
Thanks in Advance,
Norris
|
|
|
|
|
Here you Go
Get User Group Memberships
and if you are interested read the whole article. It is an Excelent article on AD.
Cheers!!
|
|
|
|
|
This article looks like it will be very useful for a variety of things. Thanks for the link, it is now bookmarked.
I am not seeing anywhere in it however that goes over getting the members of a group. The part of the article linked above will return me all group memberships a specific user has if I am undestanding it right. I have a group that contains three groups, and I want to populate the list box with the members of all three groups. The code I posted above works fine if the group directly contains user accounts, but when I use it on a group that only contains groups, I get back the subgroups instead of the user accounts.
|
|
|
|
|
Hi All,
When attempting to write or delete a file in the Application_Start event of Global.asax I receive an "Authentication Required" message box requesting a User Id and Password.
After clicking Cancel on the Message Box I receive the following.
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.
Exception Details: System.UnauthorizedAccessException: Access to the path "D:\hshome\mtbvfr\casas-y-terrenos.com\MapPathTest2009-06-17T21-48-03.txt" is denied.
ASP.NET is not authorized to access the requested resource. Consider granting access rights to the resource to the ASP.NET request identity. ASP.NET has a base process identity (typically {MACHINE}\ASPNET on IIS 5 or Network Service on IIS 6) that is used if the application is not impersonating. If the application is impersonating via <identity impersonate="true"/>, the identity will be the anonymous user (typically IUSR_MACHINENAME) or the authenticated request user.
To grant ASP.NET write access to a file, right-click the file in Explorer, choose "Properties" and select the Security tab. Click "Add" to add the appropriate user or group. Highlight the ASP.NET account, and check the boxes for the desired access.
The same code works fine in the Application_BeginRequest event.
My ISP uses the H-SPHERE control panel. The "Authentication level" is set to Anonymous. "Allow read access" and "Allow write access" are both checked.
Do I need to request my ISP to allow ASP.Net access to my directories or is there some other solution?
Thanks in advance,
Michael
Hospedaje Los Jardines & Sacred Valley Mountain Bike Tours
http://www.machawasi.com/
Cusco Database Development and Cycling Services
http://databaseservices.blogspot.com
http://serviciosdeciclismodelperu.googlepages.com
Cusco Travel Services
http://www.cusco-travel-services.com
|
|
|
|
|
I m working on window application in vb.net. where i need to Align a paragraph in rich text box. dont know how to do it as RichTextBox control provides three alignments, Left Right & Centre.
I need to align a paragraph in RichTextBox to Justify(strech each line to fit in text area), as it is in Microsoft Word application.
This is an urgent requirement. I would be greatful for immediate response
Raghvendra
|
|
|
|
|
Hi
I need to pass Popup window values to parent window.
my code is :
Response.Write("<script language='javascript'>{window.opener.document.getElementById('ctl00$ContentPlaceHolder1$txtRecipients').value += '" + MobileNos + "'}</script>");
The Above code is working fine with IE..
But it is not working with Firefox Browser ?
i tried with FireFox 2.0 & 3.0 version..
murali krishna
|
|
|
|
|
for firefox,
use the both NAME and ID property for control , keep both same
IE run with only ID.
window.opener.document.myForm.myField.value = myValue
hope it helps
regards
koolprasad2003
If the message is useful for U then please Rate This message...
Be a good listener...Because Opprtunity knoughts softly...N-Joy
|
|
|
|
|
Hello,
Thank you for reading this post. Here is my situation. I am new to AJAX development. I have a gridview with 4 boundfield columns and 1 buttonfield column. I need to display a popup anytime a user hovers over the buttonfield column and popup a panel which has some database driven text and a button which says "Add this to my plan" and a cancel button on the popup. How do i associate a hovermenu extender to a buttonfield column with targetcontrolid? Does the hovermenu controller need to be associated in the rowcommand of the gridview? How does this need to be done. A code sample or a URL where someone has already done this will help my cause mightily ! Here is the code of what I have
<asp:UpdatePanel ID="updPanel" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<ASCPWebC:GridView
ID="gvProducts" runat="server" DataSourceID="odsProducts"
OnRowDataBound="RowDataBound" AutoGenerateColumns="false" AllowPaging="true" AllowSorting="true"
CssClass="datatable" CellPadding="0" CellSpacing="0" BorderWidth="0" GridLines="None" >
<Columns>
<asp:BoundField DataField="FieldA" HeaderStyle-CssClass="first" ItemStyle-CssClass="first" DataFormatString="{0 }" HeaderText="Field A" SortExpression="ORDER_DATE" />
<asp:BoundField DataField="FieldB" HeaderText="Field B" SortExpression="FieldB" />
<asp:ButtonField CommandName="SelectDescription" DataTextField="FieldC" HeaderText="Field C" SortExpression="FieldC" />
<asp:BoundField DataField="FieldD" HeaderText="Field D" SortExpression="FieldD"/>
<asp:BoundField DataField="FieldE" HeaderText="Field E" SortExpression="FieldE"/>
</Columns>
</ASCPWebC:GridView>
<asp:Panel ID="Panel1" runat="server">
<% --Here is popup panel,this needs to have some text and an add button,cancel link -- %>
</asp:Panel>
</div>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="cblTest" EventName="SelectedIndexChanged" />
</Triggers>
</asp:UpdatePanel>
Any and all help is much appreciated.
Thanks
RH
|
|
|
|
|
I have master page with a search textbox and imagebutton that submits the search query using the postbackurl property. My problem is that on any page that is based on this master page the default button is always the search imagebutton, even if a textbox with another button in the contentplaceholder has the focus. My question is how do I set the default button of the page from within the master page to point to a button in the contentplaceholder? This is complicated by the fact that the button I would like to be the default is not always named the same on the pages that are derived from the master page and that I have quite a few pages that have this issue and I would greatly prefer not to have to change code in all of the pages.
|
|
|
|
|
Put the button on the master page inside an asp:panel. Set the default button of the panel.
I didn't get any requirements for the signature
|
|
|
|
|
|
you write codes follow
living none stoping.
|
|
|
|
|
This can be done through css. Maybe this[^] can help you.
जय हिंद
|
|
|
|
|
Hello there,
I am having a query regarding my N-layer ASP.Net application.
Suppose, I am having following projects -
- PTS.Web (Web Application)
- PTS.BLL (Business Layer Class Library)
- PTS.DAL (Data Access Class Library)
Now, as I will need ENTITY object to move data between the layers.
Where do you suggest should I create the class for my entity objects?
Should I put them in PTS.Bll or
should I create an extra class library with the name say, PTS.Common (with reference of PTS.Common added to all other projects)?
Could you please provide any idea backed up by some good reason.
Thanks in advance!
|
|
|
|
|
|
Hi,
I want to use Multiple Validation Summary in a single page(form). I want to use validation Summary for Selected validators.
Thanks !
|
|
|
|
|
You have to make sure that the Property "Error Message" has Something to be displayed
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
http://www.vuyiswamaseko.tiyaneProperties.co.za
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
you can use it. find here[^]
Education is not a way to escape poverty — it is a way of fighting it.
|
|
|
|
|
I wanna know what exactly way behind the pre class of CP. I mean if we resize the browser then pre tag also resize plus if the text inside it is bigger then it get hori-scrollbars too.
I'm trying the same but scrollbars never appears
pre
{
overflow: auto;
background-color: #666666;
width : 100%
}
any idea ?
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKQUFK[M`UKs*$GwU#QDXBER@CBN%
R0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
-----------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
Hello,
I am trying to display in a Dynamic Data app, a custom property added to the partial class of an ADO.NET Entity Framework entity class.
For example, where Person is a entity in a ADO.NET Entity Framework model, I would add:
public partial class Person
{
public string FullName { get { return FirstName + " " + LastName; } }
}
However, with Dynamic Data, it uses the internal System.Web.DynamicData.ModelProviders.EFTableProvider for generating its columns collection which only allows properties defined in the entity model to be displayed - as in only the database columns, not custom added ones.
Does anyone know any work arounds to this, or is it possible and I am missing something obvious.
Seems silly I can't do this. LINQ to SQL with Dynamic Data can do this easy as it uses reflection in its DLinqTableProvider to find all properties in the object, not just those with mappings to database fields.
EFTableProvider's enumerator to create its columns for Dynamic Data:
foreach (EdmMember member in entityType.get_Members()) // only entity DB mapped fields are returned in the Members property
DLinqTableProvider's enumerator to create its columns for Dynamic Data:
IEnumerator<PropertyInfo> enumerator = this.GetOrderedProperties(rowType.get_Type()).GetEnumerator()
where GetOrderedProperties returns a list of properties based on reflection:
PropertyInfo[] properties = type.GetProperties(BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly);
Anyone have any thoughts on how to do this effectively?
I need the many-to-many relationship management that Entity Framework provides - otherwise I would stick with LINQ to SQL.
Thanks for any help!
Cheers,
kris
|
|
|
|
|
Why are you adding the custom property? If it is to use in the DisplayColumn metadata attribute, you can override ToString on your entity to return the full name, and remove the DisplayColumn attribute, and the ToString value will be used instead for FK displays.
|
|
|
|