View Complete Post
I usually work with windows forms, and am just starting to work with ASP.Net, so appologies if this is a dumb question!
I have a master page which has a search button on it. The results of this are built up using a Linq statement and if there are any results, I want to display the results in a contents page.
On the masterpage, I have the following code:
Public Overridable ReadOnly Property SearchRes()
Private Sub DoSearch()
'some code to get a linq result
If res.Any Then
_res = res
LabelNoRes.Visible = True
On the SearchResults.aspx page I have this code.
Dim m As pxSite = CType(Page.Master, MasterPage)
If m.SearchRes IsNot Nothing Then
Label1.Text = "Results found = " & m.SearchRes.Count
m.searchRes is always nothing.
What am I doing wrong here?
I want to make Rolebase menu in MVC such that if user doesnot have permission for some action then that Action name shouldnot be shown in the Menu.
I have used the code in the url(http://forums.asp.net/t/1566328.aspx) in my MVC application.My application is a Discussion Forum(in MVC) same functionality as in this forum forums.asp.net
I have used Controllers for post, thread etc.In each controller there are some actions that are using [Authorize(Roles)] attribute
but this coding does not count those Actions in Controllers having Authorize attribute according to the url http://forums.asp.net/t/1566328.aspx
In the code, Authorize attribute is applied to Controller class, but my requirement is of Applying Authorize attribute to some actions in controller so that some are available for all users and some links are available rolewise.Now what is the solution for that?
Hello all, first ever post here :)
Hope you guys can help me out, this drives me crazy...
So I got 2 updatepanels on my page. In one there is a Timer which updates for example a label. In the other one there is a dropdownextender. Everytime the timer ticks while the dropdown menu is displayed the menu disapears. I attached the sample code below....any insights on this? And yes, the dropdown and the label need to be in two seperate updatepanels....
<form id="form1" runat="server"> <asp:ToolkitScriptManager ID="ScriptManager1" runat="server" /> <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional"> <ContentTemplate> <asp:Timer ID="Timer1" runat="server" OnTick="Timer1_Tick" Interval="4000" /> <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label> </ContentTemplate> </asp:UpdatePanel> <asp:UpdatePanel ID="UpdatePanel2" runat="server"> <ContentTemplate> <asp:DropDo
I'm not sure how to structure the code for this but what I want to do is be able to add data to a database, and once this has completed successfully, then email the user to say the details have been added successfully to the database.
I need to:
1. Check that the relevant data has been added into the database then
2. Email the details of the relevant data when completed.
Thanks in advance for your help,
I've created a SetupWizard, but can't get it to show the Icon for the shortcut on desktop and program menu. The installation goes fine without any errors, the only problem is the icon.
I've made a shortcut of my exe file in the Application Folder and dragged the shortcut to the Desktop folder, then on the shortcut properties, I assigned it an icon picture located in Application Folder.
Any suggestions will be very much appreciated.
I have never tried a group by with linq, now I do and I'm stuck.
I try to convert this sql statement to its linq counterpart :
SELECT COUNT(tb_Mailer_Smses.Id) AS [cnt], tb_Mailer_mailing.Id As [Id]
,SUM( CASE WHEN tb_Mailer_smses.DLRStatus = 200 THEN 1 ELSE 0 END) As [Delivered]
,SUM(CASE WHEN DLRStatus BETWEEN 300 AND 499 THEN 1 WHEN DLRStatus BETWEEN 800 AND 899 THEN 1 END) AS [Errors]
FROM tb_Mailer_mailing INNER JOIN
tb_Mailer_Smses ON tb_Mailer_mailing.Id = tb_Mailer_Smses.MailingId
WHERE tb_Mailer_mailing.ApplicationId = 1
GROUP BY tb_Mailer_mailing.Id
Is there some one who can me show me the convertion process ?