|
sorry not clear. can u plzz redirect me to few right article on the same topic because in code i do not want to hard code roles name with action method in asp.net mvc.
tbhattacharjee
|
|
|
|
|
Tridip Bhattacharjee wrote: can u plzz redirect me to few right article on the same topic Understanding Role Management[^]
Introduction to Membership[^]
Tridip Bhattacharjee wrote: because in code i do not want to hard code roles name with action method So, one day the action method is executed by role 1, and the next day by role 2?
That's how it works; you assign "admin" to the action method, and assign a user to that role if he/she is allowed to execute. You do not change the role.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
hello how to put multiple entries from different pages to the same gridview table.
|
|
|
|
|
For this, either you will need to store those entries to localStorage db, otherwise have a database working that will store the data entered on those 2 pages.
Then load that data from database, to show on a single page within GridView table. If you are having some sort of storing mechanism, consider sharing so that I can guide you specific for that — Session , localStorage , SqlConnection ... What?
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~
|
|
|
|
|
Hello, I am storing data in database. Program is like x1 is asking for some info. X2 and X3 has to provide those info. database has table in which approx 20 columns are present. 5 columns are used by x1. x2 and x3 have to access rest column. three pages for x1,x2 and x3 has been created to access same table.For X1 this is insert command and for x2 and x3 update command has been used as per selected row to fill the entry.even if i use labels to get the entry of X2 while putting entries by x3 through text box and try to add both entries,this is not working. when x2 enters in same cell entry of x3 gets erased and vice versa.
this is whole problem .
please guide
|
|
|
|
|
Member 12935730 wrote: when x2 enters in same cell entry of x3 gets erased and vice versa. Of course it does, because you are using UPDATE query. That query will simply ignore the previous data and overwrite it with the newer data.
Can you show the table structure, or the code being used? In any circumstances, you will have to rewrite the query to remove the updation of columns by x3 that x2 has to write. So in this case, all 3 of these x will have a different column to write in, x1 will create a new record, x2 will enter details in a few, and x3 will enter the data to a few.
If you do not want to modify your SQL queries, then chances are you will have to write a lot of validations — such as checking if data exists, and executing if data IS NOT NULL etc. That will just make things over confusing as well as complex.
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~
|
|
|
|
|
i have few questions about MCSD and MCPD exam.
1) what is difference between MCSD and MCPD ?
2) i have 10 years exp in dotnet platform. so tell me should i go for MCSD or MCPD ?
3) i heard from people who passed MCPD and they said if i do not get right brain dumps for MCSD or MCPD examp then it will be hard to pass those exam.......is it true. so my request if some one who passed recently MCSD or MCPD then please share your information for how one should prepare oneself for MCSD or MCPD examp.
4) how many questions comes in MCSD or MCPD exam and what is the duration for MCSD or MCPD exam ?
5) how do i know that MCSD or MCPD examp will take for which dotnet version and what is the syllabus for the exam ?
from where to download MCSD related brain dumps which help me to pass the exam.
please some one answer me point wise in detail for better clarity.
tbhattacharjee
|
|
|
|
|
Tridip Bhattacharjee wrote: i have 10 years exp And still not figured out how to use Google? There are a number websites devoted to the MC exams, including those managed by Microsoft.
|
|
|
|
|
Take a peek! This is my controller:
public ActionResult SaveInfo(GetOrderDetail_Result items) //This method will call a stored proc to pass parameters
{
var hold = items.Master_OrderNum;
//cb.SaveAgentViewInfo(master_OrderNum);
return View(Index());
}
When I pass the model to the Action method none of the properties are initialized from the view page.
The master_OrderNumnumber comes through as a null.
I'm calling this in my View:
document.location = '@Url.Action("SaveInfo", "ControllerName", new { Model })';
I actually use a foreach(var item in Model) to print certain things to divs on the cshtml page and all that works perfectly. But after passing that same model everything is blank inside in the controller. I don't know what side it should be initialized on. I'm new to MVC!
Help!!
|
|
|
|
|
Never mind ... I figured it out
|
|
|
|
|
I have created an ASP.NET Core website which will be a template for future web sites. I have removed Bootstrap and included W3.CSS instead, which I find easier to use and just as rich in function as Bootstrap. I have also included npm, gulp and bower and seeded them with the tools I use. I have this saved in a directory.
My problem now is that if I create a new website, I cannot find any way to include this template as the starter set. Conversely, if I open my template, I cannot find any way to save it under a new name in another directory. Every option seems to involve overwriting the template. Does anyone have any suggestions?
I know someone will say that this is easy, so in my defence, I am pleading old age and stupidity in advance.
|
|
|
|
|
xiecsuk wrote: I cannot find any way to save it under a new name in another directory. I cannot understand this point, .NET Core applications just require a main class and a JSON (in future; MSBuild) file for settings. Other stuff is not required at all, and since everything is managed "in current directory", you can place it anywhere on your device and run,
$ dotnet restore
$ dotnet run
And that will work perfectly — for .NET Core console applications as well as ASP.NET Core web applications. If this is Visual Studio, then there are some other settings in Visual Studio that cause some issues such as launchSettings.json file etc.
A simple walk around this would be, publish that template on GitHub and each time you want to create a new project, just clone it in your own local environment.
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~
|
|
|
|
|
I want to create a Visual Studio ASP.NET Core MVC website template to my own specification. As I said, I want to remove Bootstrap and use W3.CSS. It seems to be impossible to save it and then use it as a template later.
Your suggestion of using GitHub is worth pursuing. I have never used GitHub but I will investigate it.
|
|
|
|
|
Hi all,
I am writing type script files and have a tsconfig file, I am able to run those files and place the js files in one output directory, but I want to be able to place outDir in one tsconfig file because I want to place related .js files into one outDir so that bundling can be easy for me in loading them on demand. Any sort of help will be very helpful, I am new to the MVC and front end technologies. Thanks in advance and happy new year 2017
Here is my tsconfig looks like, in the below tsconfig code I want to put the search.js file in different outDir, File834.js in different folder and both Validation.js, Calculator.js in one another outDir, can anybody please help me.
{
"compilerOptions": {
"module": "system",
"noImplicitAny": true,
"noEmitOnError": true,
"sourceMap": true,
"target": "es5",
"outDir": "./Scripts/Search"
},
"files": [
"./src/search.ts",
"./src/File834.ts",
"./src/Validation.ts",
"./src/Calculator.ts"
],
"compileOnSave": true
}
Thanks,
Abdul Aleem
"There is already enough hatred in the world lets spread love, compassion and affection."
modified 3-Jan-17 16:34pm.
|
|
|
|
|
Hi all,
I have an ASP.Net MVC application using Web API Controller, I want to call get method for Button Click using TypeScript, here is my Web Api Controller and its action method.
public class HomeController : ApiController
{
[System.Web.Http.ActionName("GetByString")]
public IEnumerable<File834Dto> Get(string subscriberNumber)
{
var someObj = SearchResults.SearchBySubscriberNumber(subscriberNumber);
return (someObj != null) ? someObj.FileResults : null;
}
}
And here is my HTML, I want to bind the results to the divSearchResult listbox, any sort of help would be very helpful, I am little bit new to the front end world, thanks in advance.
@{
ViewBag.Title = "Home Page";
}
<script src="~/Scripts/Search/search.js"></script>
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width" />
<title>Home Page</title>
</head>
<body style="position: absolute; height: 98%;min-height:98%;width:85%;min-width:85%;">
<div style="position: absolute; height: 90%;min-height:90%;width:95%;min-width:95%;">
<div style="position: absolute; height: 90%;min-height:90%;width:95%;min-width:95%;">
<div id="divSearchResult" style="height: 90%;min-height:90%;width:95%;min-width:95%;">
<select name="cars" multiple="multiple" style="position: absolute; top:5%;">
<option value="volvo">Volvo Volvo Volvo Volvo Volvo Volvo Volvo Volvo Volvo Volvo Volvo Volvo Volvo Volvo Volvo Volvo</option>
<option value="saab">Saab</option>
<option value="fiat">Fiat</option>
<option value="audi">Audi</option>
</select>
<label style="position: absolute; left:400px; top :5%;">Test</label>
<select name="cars" multiple="multiple" style="position: absolute; left:400px; top :10%;">
<option value="volvo">Volvo Volvo Volvo Volvo Volvo Volvo Volvo Volvo Volvo Volvo Volvo Volvo Volvo Volvo Volvo Volvo</option>
<option value="saab">Saab</option>
<option value="fiat">Fiat</option>
<option value="audi">Audi</option>
</select>
</div>
<div id="divSearch">
<p>
<input type="text" name="txtSubscriberIdOrName">
</p>
<p>
<button style="width: 150px; border-radius: 5px; background: url('../../Content/Images/search-icon-psd-png.jpg'); background-size: 25%, 25%, 25%;background-repeat: no-repeat;"
id="search_report">
Search
</button>
</p>
</div>
<div id="message"></div>
<div>
Compiler: <input id="compiler" value="TypeScript" onkeyup="document.getElementById('message').innerText = sayHello()" /><br />
Framework: <input id="framework" value="ASP.NET" onkeyup="document.getElementById('message').innerText = sayHello()" />
</div>
</div>
</div>
</body>
</html>
Thanks,
Abdul Aleem
"There is already enough hatred in the world lets spread love, compassion and affection."
modified 3-Jan-17 16:35pm.
|
|
|
|
|
In an MVC Details view, it displays the field names down the left side using dt tags and it displays the data down the right side using dd tags.
My issue is that a few of my field names are longer than the room that is provided, so the last word or two of the column header drops down to the next line. How can I expand the available width for the field names column?
I have tried using CSS to set the Width and Column-Width properties of the dt tags. Neither one has any effect.
modified 24-Dec-16 2:06am.
|
|
|
|
|
Instead of that, why won't you chop the last words off?
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~
|
|
|
|
|
I'm creating a web application for a hospital and they have all these columns with very specific meanings. I decided to just copy everything into a simple table. That should work. ![Java | [Coffee]](https://codeproject.global.ssl.fastly.net/script/Forums/Images/coffee.gif)
|
|
|
|
|
No, I mean keep everything, just present everything in a good nature. Either keep the entire column to same size, let the content hide, or use adaptive approach (which is, the one you are facing right now), or strop down extra words, show only 4-5 and write "..." infront.
You can still have all the content in database, but just present it in a cleaner way.
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~
|
|
|
|
|
Assuming you're using Bootstrap's horizontal description list[^], you just need a couple of rules:
.dl-horizontal dt {
width: 200px;
}
.dl-horizontal dd {
margin-left: 220px;
}
This will affect all horizontal description lists. If you only want to change specific lists, you'll need to add a new CSS class to identify them.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
I've an application that displays information in a gridview:
<asp:GridView ID="GridView1" runat="server" AllowPaging="True" AllowSorting="True"
AutoGenerateColumns="False" Font-Size="X-Small" OnRowDataBound="GridView1_RowDataBound"
PageSize="100" DataSourceID="SiteDataSource1" Width="100%">
<PagerSettings Mode="NumericFirstLast" PageButtonCount="20" Position="TopAndBottom" />
<RowStyle CssClass="itemstyle" />
<HeaderStyle CssClass="headerstyle" />
<AlternatingRowStyle CssClass="altstyle" />
<Columns>
<asp:BoundField DataField="Description" HeaderText="Description" ReadOnly="True" SortExpression="Description">
<ItemStyle Wrap="False" />
</asp:BoundField>
<asp:BoundField DataField="Identifier" HeaderText="Identifier" ReadOnly="True" SortExpression="Identifier">
<ItemStyle Wrap="False" />
</asp:BoundField>
<asp:BoundField DataField="State" HeaderText="State" ReadOnly="True" SortExpression="State">
<ItemStyle Wrap="False" />
</asp:BoundField>
<asp:BoundField DataField="HostHeaderValue" HeaderText="Host Header Value" ReadOnly="True"
SortExpression="HostHeaderValue" />
<asp:BoundField DataField="IPAddress" HeaderText="IP Address" ReadOnly="True" SortExpression="IPAddress" />
<asp:BoundField DataField="Port" HeaderText="Port" ReadOnly="True" SortExpression="Port" />
<asp:BoundField DataField="SSLPort" HeaderText="SSL Port" ReadOnly="True" SortExpression="SSLPort" />
<asp:TemplateField ShowHeader="False">
<ItemTemplate>
<asp:Button ID="Button1" runat="server" CausesValidation="false" CommandName="Control"
OnClick="Button_Clicked" Text="Control" Width="50" />
</ItemTemplate>
<ItemStyle Width="50px" />
</asp:TemplateField>
</Columns>
the status of the button is set
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
try
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
DataRowView entry = e.Row.DataItem as DataRowView;
if (entry != null)
{
switch (entry["State"] as string)
{
case "Stopped":
e.Row.Cells[2].BackColor = System.Drawing.Color.OrangeRed;
e.Row.Cells[2].ForeColor = System.Drawing.Color.White;
((Button)e.Row.Cells[7].Controls[1]).Text = "Start";
((Button)e.Row.Cells[7].Controls[1]).ForeColor = System.Drawing.Color.Green;
((Button)e.Row.Cells[7].Controls[1]).CommandArgument = entry["Site"] as string + "|" + entry["Description"] as string;
break;
case "Running":
e.Row.Cells[2].BackColor = System.Drawing.Color.Honeydew;
((Button)e.Row.Cells[7].Controls[1]).Text = "Stop";
((Button)e.Row.Cells[7].Controls[1]).ForeColor = System.Drawing.Color.Red;
((Button)e.Row.Cells[7].Controls[1]).CommandArgument = entry["Site"] as string + "|" + entry["Description"] as string;
break;
default:
e.Row.Cells[2].BackColor = System.Drawing.Color.Yellow;
e.Row.Cells[7].Text = "";
break;
}
on a Windows 2008 server the button displays with no issues, however when I view this page with the gridview the column with the button is empty on a Windows 2012 server. Has anyone seen this before? Any help/advice greatly appreciated.
|
|
|
|
|
Did you try to look into, why it was empty?
Your server's variables are not shown to us and we cannot debug it without enough information.
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~
|
|
|
|
|
besides debugging the application and stepping through the code that sets the buttons values what else can I do?
In my test the code is hitting this case within the switch:
case "Stopped":
e.Row.Cells[2].BackColor = System.Drawing.Color.OrangeRed;
e.Row.Cells[2].ForeColor = System.Drawing.Color.White;
((Button)e.Row.Cells[7].Controls[1]).Text = "Start";
((Button)e.Row.Cells[7].Controls[1]).ForeColor = System.Drawing.Color.Green;
((Button)e.Row.Cells[7].Controls[1]).CommandArgument = entry["Site"] as string + "|" + entry["Description"] as string;
break;
but when to code has finished running and the webpage is displayed, here's the source of the webpage:
<tr class="headerstyle">
<th scope="col"><a href="javascript:__doPostBack('UcSites1$GridView1','Sort$Description')">Description</a></th><th scope="col"><a href="javascript:__doPostBack('UcSites1$GridView1','Sort$Identifier')">Identifier</a></th><th scope="col"><a href="javascript:__doPostBack('UcSites1$GridView1','Sort$State')">State</a></th><th scope="col"><a href="javascript:__doPostBack('UcSites1$GridView1','Sort$HostHeaderValue')">Host Header Value</a></th><th scope="col"><a href="javascript:__doPostBack('UcSites1$GridView1','Sort$IPAddress')">IP Address</a></th><th scope="col"><a href="javascript:__doPostBack('UcSites1$GridView1','Sort$Port')">Port</a></th><th scope="col"><a href="javascript:__doPostBack('UcSites1$GridView1','Sort$SSLPort')">SSL Port</a></th><th scope="col">Button</th>
</tr><tr class="itemstyle">
<td style="white-space:nowrap;">Default Web Site</td><td style="white-space:nowrap;">1</td><td style="color:White;background-color:OrangeRed;white-space:nowrap;">Stopped</td><td> </td><td> </td><td>80</td><td> </td><td style="width:50px;">
</td>
</tr>
You can see the cell[2] is updated with an OrangeRed background and white text. I've followed the code the whole way through and there is no where else it is manipulated, very strange.
What this application does is it reviews the status of Sites setup in IIS and displays their status in the gridview and if the site status = stopped the button should display 'start' and so on.
|
|
|
|
|
pmcm wrote: the column with the button is empty If the column is empty that means you have code somewhere that is hiding the button, .Visible = false; or some other code that is messing something up.
There are two kinds of people in the world: those who can extrapolate from incomplete data.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
turns out there was a database query that runs to validate the server is in an admin group after the button is set, atm the query is returning null so this is why the button is being disabled. Thanks for all the advice/help
|
|
|
|