|
Right but we need the not working version otherwise how can anyone see what's wrong?
Additionally, did you check my other point?
|
|
|
|
|
I would highly recommend not hard coding the text box id in your JavaScript custom validation function. It limits its reuse. Everything you need can be retrieved from sender and args.
|
|
|
|
|
How to implement webmethods for unit measurement conversions in asp.net web appication
|
|
|
|
|
|
|
Hi,
I have a user control as below
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="HealthTopicTreeUC.ascx.cs" Inherits="ResearchStudiesAdmin.Website.Controls.Framework.HealthTopicTreeUC" %>
<asp:Panel ID="pnlRadTreeHealthTopic" runat="server" EnableViewState="true">
<div class="formInputs">
<div style="width:90%">
</div>
<div class="clearfix"></div>
<telerik:RadTreeList
ID="rtlManageHealthTopics"
runat="server"
Height="400px"
Width="500px"
Skin="Silk"
CssClass="ControlOverrideText"
OnNeedDataSource="rtlManageHealthTopics_NeedDataSource"
ParentDataKeyNames="ParentHealthTopicId"
DataKeyNames="HealthTopicId"
DataTextField="Name"
ClientSettings-Scrolling-AllowScroll="true"
AllowPaging="false"
PageSize="30"
AllowSorting="false"
EditMode="PopUp"
GridLines="Both"
AutoGenerateColumns="false"
AllowMultiColumnSorting="false"
OnSelectedIndexChanged="rtlManageHealthTopics_SelectedIndexChanged"
ClientSettings-AllowPostBackOnItemClick="true">
<EditFormSettings EditFormType="AutoGenerated" />
<ClientSettings Selecting-AllowItemSelection="true" />
<Columns>
<telerik:TreeListBoundColumn DataField="Name" UniqueName="Name" HeaderText="<%$Resources:HealthTopics,LabelHealthTopicTreeHealthTopic %>" HeaderStyle-Font-Bold="true" HeaderStyle-Font-Size="Small" />
<telerik:TreeListBoundColumn DataField="HealthTopicLevel" UniqueName="HealthTopicLevel" Visible="false" />
</Columns>
</telerik:RadTreeList>
</div>
<div class="clearfix"></div>
</asp:Panel>
Then I have a variable: public TaxanomySelectedItem _healthTopicSelectedItem;
Now when I try to access this in the web page as below
if (HealthTopicTreeUC1._healthTopicSelectedItem != null)
{
var _selectedHealthTopicId = HealthTopicTreeUC1._healthTopicSelectedItem.TaxanomyChildIdSelected;
}
The HealthTopicTreeUC1._healthTopicSelectedItem becomes null, when it is not null in the user control but in the asp.net page it is showing as null.
How can I access the variable or property that's in the user control in the aspx code behind?
Any help like a link, code snippet or even a suggestion would be very very helpful.
Thanks in advance.
Thanks,
Abdul Aleem
"There is already enough hatred in the world lets spread love, compassion and affection."
|
|
|
|
|
You need to show us the relevant parts of the control's code-behind. Accessing public properties of user controls is something that normally just works, so there must be something odd about your property.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Hi Rick,
There is no much change except I put Property like this in the user control code:
public TaxanomySelectedItem _healthTopicSelectedItem { get; set; }
Did I do any mistake by doing it, still it is returning me the null value.
any help is appreciated Rick.
Thanks,
Abdul Aleem
"There is already enough hatred in the world lets spread love, compassion and affection."
|
|
|
|
|
So where's the code that sets that property?
NB: The value of that property will not persist between requests. If you set the property, render the page, and the user then causes a post-back, the property value will be reset to null . If you want the value to persist between requests, then you'll need to use ViewState to store it.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
As per topic, Has anyone got idea on how to dynamically change the attribute value of web form user control called 'commandValue' which is also known as public variable declared in user control. I need to know how to refresh div's content from changes.
<div id="MachineName" style="display:none" >
<uc1:MachineNameControl runat="server" ID="MachineNameControl" commandValue =""/>
</div>
$("#MachineName").dialog({
autoOpen: false,
width: 450,
height: 560,
title: "Select a Machine",
modal: true,
buttons: {
"Back to Depart Group": function () {
},
Close: function () {
$(this).dialog('close');
}
},
});
$("#MachineName").dialog('open');
$("#MachineName").parent().appendTo($("form:first"));
|
|
|
|
|
You have to know the client id of whatever html control is actually generated by the usercontrol. Just choose to View Source on a rendered page and you'll see what the id is. For example, if it is a textbox you just need to do:
$("#usercontrol_txtMachineName").val("whatever you want.");
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
Hi All,
I just got latest from my source code, I started getting the below error, can anybody please let me know what could be the reason for the error.
"Access to the path 'D:\Projects\SXXXXX\Source\SH.XXXXXXX.WebUI\App_GlobalResources\Glossary.resx' is denied."
Any help a link, a code snippet or even a suggestion would be great helpful, thanks in advance.
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.
Parser Error Message: Access to the path 'D:\Projects\SXXXX\v2.2.0\Trunk\Source\SXXXX.WebUI\App_GlobalResources\Glossary.resx' is denied.
Source Error:
[No relevant source lines]
Source File: /App_GlobalResources/Glossary.resx Line: 1
Thanks,
Abdul Aleem
"There is already enough hatred in the world lets spread love, compassion and affection."
|
|
|
|
|
The message is quite clear, access to that path on the server is denied, possibly because of permissions. You need to investigate to find out why.
|
|
|
|
|
As already told, the problem is with the permissions your application has to access the file resource. Typically, applications are granted read-only permissions. But something that is also not available so just change the permissions and allow read and write actions to be performed.
From the URL, it is clear that the error occurs on your development machine. You can easily edit the permissions to that file.
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~
|
|
|
|
|
Yeah Thanks I got it fixed should give the permissions to the IIS_IUSRS user and restart IIS would solve the problem.
Thanks,
Abdul Aleem
"There is already enough hatred in the world lets spread love, compassion and affection."
|
|
|
|
|
Hello Gurus,
Normally, when we conduct community elections, one of two rules usually applies.
1, Every one from various communities are allowed to participate in the election.
2, Only certain groups of communities are allowed to participate in the election.
I usually handle these restrictions with the following code:
Dim CommunitiesAllowed = New List(Of String)(
{ _
"East Community" _
})
If Not CommunitiesAllowed .Contains(txtComm.Text) Then
lblNA.Text = "Voters in community" & txtComm.Text & " are not eligible to vote in this election."
End If
With the example above, if a voter does not come from East Community, that voter is not allowed to vote and a message displaying that voters community saying the voter is allowed to vote since his/her community does not match community listed above.
This time, the requirement is different. We have two elections, one election going in East Community only and another going on for ALL communities.
The rule this time is that if you are from East Community, you can participate in both East Community election as well as the general election involving all communities.
However, if you are not from East Community, you can participate in general election but NOT in the East Community election.
Any ideas how to modify above code to satisfy this rule?
Thanks in advance
|
|
|
|
|
According to your explanation nothing has really changed.
Old:
If found in allowed community list then allowed to vote in that election
If not found in allowed community list then not allowed to vote in that election
New:
If found in allowed community list then allowed to vote in that election, and can vote in general
If not found in allowed community list then not allowed to vote in that election, and can vote in general
So keep the same code you have for non-general, and simply allow anyone to vote in the general.
modified 9-Feb-16 11:31am.
|
|
|
|
|
I think there are a couple of nots missing.
|
|
|
|
|
Me make a mistake? Unlikely
|
|
|
|
|
To err is human ... I assume you are human.
|
|
|
|
|
I can't figure out why my 2 route values won't render for ActionLink. I'm stumped on this!
Oh, the first one customerID renders fine.
@Html.ActionLink("Edit", "CustomerEditor", "Admin", new { customerID = item.CustomerID, action = "edit" }, new { @class = "action edit" })
@Html.ActionLink("Delete", "CustomerEditor", "Admin", new { customerID = item.CustomerID, action = "delete" }, new { @class = "action delete" })
|
|
|
|
|
All the other words work, and even task = "delete" works.
Maybe action is a key word, and can't be used.
[edit]
I changed the word from action to operation.
It must be a key word to razor.
modified 4-Feb-16 18:47pm.
|
|
|
|
|
Presumably because "action" is already defined in the route as the name of the controller action you're calling?
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
There it is!
I looked at it several times, thought maybe I needed a new route.
There I go again taking the examples literally. I need to stop that, but in foresight I will get the hang of MVC. I'm starting to like this MVC, but less time to write things.
At least I'm typing out c# pretty naturally now without having to lookup things.
Thanks Richard for pointing that out!
routes.MapRoute(
name: "Default",
url: "{controller}/{action}/{id}",
defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
);
|
|
|
|
|
MS SQL Server 2012 Database
Table = ZoningInfo
Field = DistrictID from Table ZDistrict
Would like to display DistrictDesc instead of DistrictID in DetailsView.
Changed the Text Box to a DropDownbox.
When I display the page is shows the dropdown but not the underlying DistrictID/DistrictDesc. It displays the first item in the List for ZDistrict.
Any Help would be great.
Thanks
Jack
|
|
|
|