 |
 |
Apologies for the shouting but this is important.
When answering a question please:
- Read the question carefully
- Understand that English isn't everyone's first language so be lenient of bad spelling and grammar
- If a question is poorly phrased then either ask for clarification, ignore it, or mark it down. Insults are not welcome
- If the question is inappropriate then click the 'vote to remove message' button
Insults, slap-downs and sarcasm aren't welcome. Let's work to help developers, not make them feel stupid.
cheers,
Chris Maunder
The Code Project Co-founder
Microsoft C++ MVP
|
|
|
|
 |
For those new to message boards please try to follow a few simple rules when posting your question.- Choose the correct forum for your message. Posting a VB.NET question in the C++ forum will end in tears.
- Be specific! Don't ask "can someone send me the code to create an application that does 'X'. Pinpoint exactly what it is you need help with.
- Keep the subject line brief, but descriptive. eg "File Serialization problem"
- Keep the question as brief as possible. If you have to include code, include the smallest snippet of code you can.
- Be careful when including code that you haven't made a typo. Typing mistakes can become the focal point instead of the actual question you asked.
- Do not remove or empty a message if others have replied. Keep the thread intact and available for others to search and read. If your problem was answered then edit your message and add "[Solved]" to the subject line of the original post, and cast an approval vote to the one or several answers that really helped you.
- If you are posting source code with your question, place it inside <pre></pre> tags. We advise you also check the "Encode "<" (and other HTML) characters when pasting" checkbox before pasting anything inside the PRE block, and make sure "Use HTML in this post" check box is checked.
- Be courteous and DON'T SHOUT. Everyone here helps because they enjoy helping others, not because it's their job.
- Please do not post links to your question into an unrelated forum such as the lounge. It will be deleted. Likewise, do not post the same question in more than one forum.
- Do not be abusive, offensive, inappropriate or harass anyone on the boards. Doing so will get you kicked off and banned. Play nice.
- If you have a school or university assignment, assume that your teacher or lecturer is also reading these forums.
- No advertising or soliciting.
- We reserve the right to move your posts to a more appropriate forum or to delete anything deemed inappropriate or illegal.
cheers,
Chris Maunder
The Code Project Co-founder
Microsoft C++ MVP
|
|
|
|
 |
In a vb.net 2010 web form application. I need to allow the help desk to be able to query up to 3 different tables when the need arises. This a support web page that supports a particular application that already exists.
The web page gives the help desk people directions for updating active directories and searching 2 tables.
My questions are about the 2 tables that need to be searched which includes:
1. If I place the access to all 2 tables on the same webpage in 2 separate gridview controls. is there a way for the webpage to show up all 2 gridview controls containing no data The user would have to complete searches to obtain the data. If so. can you show me code. point to a reference and/or tell me how to accomplish this goal?
2. Would you place the gridview controls on the same web page or different web page? Would you tell me where you would place the 2 gridview controls and why you decided on your recommendation?
|
|
|
|
 |
Hello
I have a couple of aspx forms in my VB.NET project. Eventually, these forms will be used on a Classic ASP site which has already been created. The user will click on a link on a Classic ASP page and one of these ASP.NET forms will appear in a smaller window as there is no need for a log-in form to occupy the entire screen.
Therefore, I need to reduce the size of the form that I have - at the moment each form fills the whole screen - and I wonder what is the best way of reducing the size of the form?
Thanks!
|
|
|
|
 |
You would have to size everything using % in CSS
width: 100% or width: 80%
Its no different than making the same page expand and contract resizing the browser window
|
|
|
|
 |
How can I get active directory attributes such account locked or user not in active directory?
|
|
|
|
 |
I did find the LogonUser class which I am experimenting with but am not having much success.
modified yesterday.
|
|
|
|
|
 |
I m preparing a project on airline reservation system
so i am having a problem in preparing bacend in mongodb.
so i need connectivity code of .net and mongodb.
|
|
|
|
 |
There are plenty of samples online. Where are you stuck?
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
 |
I was reading some articles about how to implement a service layer in MVC applications yesterday. One thought that came to mind was: what about data annotations used for model state validation? When you implement a service layer, do you get rid of those data annotations (like [Required] or [MaxLength]) for the model classes? This[^] is the article I was reading.
MVC development is mostly new to me, aside from the fact that I have a fundamental knowledge of the core concepts. I switched employers recently and our work here is done primarily in MVC, which I'm happy about because I've been wanting to get into it for a while now. My two coworkers are more knowledgeable than I am, for sure, but they're open to new ideas and new techniques that may help improve the applications. I figured a service layer would be beneficial not only to remove business/validation logic from controllers, but also because we're starting to write unit tests.
djj55: Nice but may have a permission problem
Pete O'Hanlon: He has my permission to run it.
|
|
|
|
 |
Hi Matt,
If I get you correctly then are pointing towards that if you have BL or service layer then you would do away with Model? Correct me if I'm wrong.
But, please note that model is the manifestation of your view i.e. it is tightly coupled to your view. You should have that as well as Business layer where you would get the data (from DAL), do some processing and then pass the data onto the model. Also, note that model does not do away DTO as well which would be used to communicate between your various layers. A lot of the time DTO and models are pretty much the same but can differ based on the requirements.
|
|
|
|
 |
Thank you, Rohit. But no, I know the model is necessary. What I'm referring to is: are data annotation attributes used for validation (like "[Required]") irrelevant when using a service layer?
djj55: Nice but may have a permission problem
Pete O'Hanlon: He has my permission to run it.
|
|
|
|
 |
But, Matt data annotations are for validations on the view side and nothing to do with your BL/service layer. Basically in MVC, models are responsible data validations.
I would still do the required validations on my BL/service side (required, null, etc.)
|
|
|
|
 |
How do annotations pass through serialisation (JSON)?
Caveat: I am even less knowledgeable about MVC!
MVC, being server based can have the DAL/Models etc in the same project, eliminating the service component. I don't like that design and will need to look at a service component so this is relevant to me.
So the service would supply data based on the Table/View structure from the database via json and the MVC would then deserialise them into UI models.
This to me reduces the benefits of using EF spit as the DAL as it is bloody useless in a service.
Never underestimate the power of human stupidity
RAH
|
|
|
|
 |
we are managing in sql server. I came to know that when we manage session in sql server then session end event never fire..,.is it true? Just guide me how to capture session timeout when we manage session in sql server. Thanks
tbhattacharjee
|
|
|
|
|
 |
MY ssrs report can not be accessed from a specific mobile operator (Grameenphone Bangladesh Ltd).Any solution pls???
|
|
|
|
 |
Sounds like a permission issue.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
 |
If you don't know what exactly asked for pls dont give any reply.thank you......
|
|
|
|
 |
No one can possibly know exactly what the issue is based on the tiny amount of information you provided.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
 |
Hi,
I am using Visual Studio 2010, VB.NET, my site has .NET 4, using Web Forms. I have a page with, among other things, two asp:ImageButton controls, each in its own little AJAX UpdatePanel. This page has been working since some time in 2013. One button is Add To Wishlist, the other Add To Cart. Both have an OnClick event and they are nearly identical, with the exception of the purpose and SQL Server stored procedure they call. As I said, they've both been working for quite a while. I made no changes to the page. Yet, suddenly, the Add to Cart button does not work...nothing happens, no error is thrown, it just doesn't do anything. the Add to Wishlist button still works as before. When they are updated, the image is changed. Add to Cart image is changed to "In Cart", Add to Wishlist is changed to "In Wishlist".
I've seen some complaints about ImageButtons not working in the latest IE, but this is in Firefox as well as IE.
I don't understand why one works and the other doesn't, and why it happened when no changes were made to the page.
My site is on a shared hosting plan at web.com, so there are many things that I cannot do. I only have access to certain things on the server.
Could a change they made cause this? But still, one button still works, same page, nearly the same exact code.
there are actually two pages, one is for pay items, one is for freebies. Both use the same code, and the Add to Cart button is not working on either page...both were working until recently.
I thought that perhaps the page was corrupted, so I re-uploaded the pay item page and cycled the application (I at least can do that), but it made no difference.
Help!
Dana
|
|
|
|
 |
Can you clarify if it is the process that fails or just the change of image. IE is the record written to the cart table is SQL.
Never underestimate the power of human stupidity
RAH
|
|
|
|
 |
Nothing at all happens. It is as though I clicked on a word of text on the page. Nothing happens. The code in the OnClick event never fires, the data is not written, the image doesn't change.
Dana
|
|
|
|
 |
Try using IE 9+ and pressing F12, then the bug button and run the page, see if an error is generated.
|
|
|
|
 |
Thanks.
It actually did:
Sys.WebForms.PageRequestManagerServerErrorException: An unknown error occurred while processing the request on the server. The status code returned from the server was: 0
Unknown error, code 0. Really helpful.
The wishlist button does not throw this error.
Dana
|
|
|
|
|
 |
Yes, I did:
Protected Sub btnAddToCart_Click(sender As Object, e As System.Web.UI.ImageClickEventArgs)
And the Add to Wishlist button:
Protected Sub btnAddToWishlList_Click(sender As Object, e As System.Web.UI.ImageClickEventArgs)
Dana
|
|
|
|
 |
You may have a response.write in the code somewhere that runs in the update panel
|
|
|
|
 |
Nope. And as I said in the original post, it was working since 2013, and the page wasn't changed. It just suddenly started this recently. The button is the only thing in the update panel.
Dana
|
|
|
|
 |
Hi all, I have posted an article but its image links are broken. Can anybody from Approval team look it? here is link of article. www.codeproject.com/Tips/816581/Create-a-Class-Collection-of-another-Class-Extend Thanks, Prakash
|
|
|
|
 |
Why are you posting this in the ASP.NET forum and not the Article Writing[^] forum?
|
|
|
|
 |
Hello
If I have this in the <body> tags of my Site.master file:
<div class="navbar-collapse collapse">
<!--<ul class="nav navbar-nav">
<li><a runat="server" href="~/">Home</a></li>
<li><a runat="server" href="~/About">About</a></li>
<li><a runat="server" href="~/Contact">Contact</a></li>
</ul>-->
<asp:LoginView runat="server" ViewStateMode="Disabled">
<AnonymousTemplate>
<ul class="nav navbar-nav navbar-right">
<li><a runat="server" href="~/Account/Register">Register</a></li>
<li><a runat="server" href="~/Account/Login">Log in</a></li>
</ul>
..............
and this in the <head> tags:
<link rel="stylesheet" type="text/css" href="logon.css">
Why can't my vb.net project see the logon.css file that I created:
.nav a:link { color: #ffffff; text-decoration: none; }
.nav a:hover { color: #ffffff; text-decoration: underline !important; }
and which appears in Solution Explorer (please see screenshot).
Basically, I am trying to change the colour of two links, 'Register' and 'Log on', to white.
Thank you.
|
|
|
|
 |
You just drag the file from the solution explorer onto the web form in the head tag section and it will automatically build the correct link for CSS and JavaScript files.
It will just work.
Your link is wrong
|
|
|
|
 |
Hello jkirkerx
Thanks for that advice. I didn't know about the dragging the file. Anyway, I did it and it has left the following in my <head> tags:
<link href="logon.css" rel="stylesheet" />
Unfortunately, it has not changed the text colour link.
|
|
|
|
 |
You have a CSS issue then
You can put a slash in front of the href, if the file is in the root of the web site folder.
<link href="/logon.css" rel="stylesheet" />
I not sure what your trying to do, I get that your trying to change the text color.
My typical CSS file looks like this
I call it a theme file, in which this file controls the theme of the web pages
The first 4 sections set the elements input, textarea, option, the next sets the elements html and body
One you set stuff globally, then you can fine tune other stuff by using ID names and Class Names
a img {border:none;}
input, textarea, option, .nobox{
background: transparent;
border: 0;
font-size: 100%;
margin: 0;
outline: 0;
padding: 0;
vertical-align: baseline;
}
html, body
{
margin: 0px auto;
color: #808080;
background: #383838;
font-family: Arial, Helvetica, sans-serif;
font-size: 80%;
font-size: 100%;
padding: 0 0 0 0px;
height: 100%;
}
.PageBackground
{
text-align: center;
}
#DefaultHeader_Wrapper_Home
{
background-image: url('/images/theme/bg-repeat_x_OtherDark.png');
background-repeat: repeat-x;
background-position: left top;
height: 800px;
width: 100%;
}
#DefaultHeader_Wrapper_Black
{
background-image: url('/images/theme/bg-repeat_x_OtherBlack.png');
background-repeat: repeat-x;
background-position: left top;
height: 800px;
width: 100%;
}
|
|
|
|
 |
Thanks again for your reply.
Unfortunately,
<link href="/logon.css" rel="stylesheet" />
doesn't do anything.
If I use the same CSS in a normal HTML page like this:
http://www.bayingwolf.com/test.html[^]
It works.
The CSS Site.master attributes which govern those two links whose colour I want to change are these:
<div class="navbar-collapse collapse">
............
<asp:LoginView runat="server" ViewStateMode="Disabled">
<AnonymousTemplate>
<ul class="nav navbar-nav navbar-right">
<li><a runat="server" href="~/Account/Register">Register</a></li>
<li><a runat="server" href="~/Account/Login">Log in</a></li>
</ul>
Now, if I go to Chrome, click on Inspector, and search for navbar-right, I can see these and other CSS values in bootstrap (screenshot).
http://www.bayingwolf.com/PropertiesCSS_bootstrap.jpg[^]
Is it somewhere here that I need to make some changes?
|
|
|
|
 |
Either program to the element A for hyper link
a:visited, a:active, a:link
{
color: rgb(255,255,255);
font-size: 1.0em;
font-weight: bold;
}
or assign a class name to the hyperlink
if you don't program the CSS for the A element, it will be purple by default after you click on it.
Blue for never used, purple for being used.
|
|
|
|
 |
OK, I now have this in that logon.css file that I dragged into my <head> tags in Site.master:
.nav a:link {color: #ffffff; text-decoration: none; }
.nav a:active {color: #ffffff; text-decoration: none; }
.nav a:visited {color: #ffffff; text-decoration: none; }
.nav a:hover { color: #ffffff; text-decoration: underline !important; }
a:visited, a:active, a:link
{
color: rgb(255,255,255);
font-size: 1.0em;
font-weight: bold;
}
http://www.bayingwolf.com/sameGrey.jpg[^]
Those two links are still that same grey colour.
Something, somewhere is simply preventing it from recognising my attempted to change the colour!
Thanks again for your time and patience.
|
|
|
|
 |
I think it would be this way
but in the <a class="nav" >Register</a>
a.nav:link {color: #ffffff; text-decoration: none; }
a.nav:active {color: #ffffff; text-decoration: none; }
a.nav:visited {color: #ffffff; text-decoration: none; }
a.nav:hover { color: #ffffff; text-decoration: underline; }
|
|
|
|
 |
Sorry, not sure I understand.
I know .nav in defined in the logon.css file, but how would I use
<a class="nav" >Register</a>
with
<li><a runat="server" href="~/Account/Register">Register</a></li>
<li><a runat="server" href="~/Account/Login">Log in</a></li>
|
|
|
|
 |
<li><a runat="server" CssClass="nav" href="~/Account/Register">Register</a></li>
<li><a runat="server" CssClass="nav" href="~/Account/Login">Log in</a></li>
|
|
|
|
 |
<li><a runat="server" CssClass="nav" href="~/Account/Register">Register</a></li>
<li><a runat="server" CssClass="nav" href="~/Account/Login">Log in</a></li>
<!--<li><a runat="server" href="~/Account/Register">Register</a></li>
<li><a runat="server" href="~/Account/Login">Log in</a></li>-->
Frustrating, I know, but the text links remain that dreary grey.
I might just have to leave them like that.
You have tried everything, thanks.
|
|
|
|
 |
If I copy and paste this:
.nav a:link {color: #ffffff; text-decoration: none; }
.nav a:active {color: #ffffff; text-decoration: none; }
.nav a:visited {color: #ffffff; text-decoration: none; }
.nav a:hover { color: #ffffff; text-decoration: underline !important; }
a:visited, a:active, a:link
{
color: rgb(255,255,255);
font-size: 1.0em;
font-weight: bold;
}
into the <head> tags of Site.master using <style></style> the colour of the text links remains grey, but I noticed that the font had changed from normal to bold as in your 'font-weight: bold;', so something is happening, it's just not clear what exactly!
|
|
|
|
 |
The latter example is global, in which all hyperlinks will adapt that style.
Something else in the css file is changing the color of the text, there is another section of the file that is changing the color like
html, Body
a
You can go inline css to override the css files commands and give that feeling of moving forward with it
<!-- <a runat="server" style="color: rgb(255,255,255); font-size: 1.0em; font-weight: bold; test-deciration: underline;" href="~/Account/Register">Register
|
|
|
|
 |
Getting somewhere!
This:
<a runat="server" style="color: rgb(255,255,255); font-size: 1.0em; font-weight: normal; text-decoration: underline;" href="~/Account/Register">Register</a>
<a runat="server" style="color: rgb(255,255,255); font-size: 1.0em; font-weight: normal; text-decoration: underline;" href="~/Account/Login">Log in</a>
finally shows the text in white (underlined) due to the text-decoration.
|
|
|
|
 |
Apllay Specific folder Path
|
|
|
|
 |
Thank you for your reply.
So something like this (according to examples I have seen elsewhere) as logon.css is in my Account folder:
link href="<%=ResolveUrl("~/Account/logon.css")%>"
Thanks again
|
|
|
|
 |
Hi,
There is two dropdown list on page. One is for State and second one is for City related to that sate only.
I have added the Name of state in first dropdown list and would like to write programming in such a way so
that when I select the name of state the city related to that state adds automatically in second dropdown list.
I tried many code but all are giving error.
like
protected void State_DropDownList_SelectedIndexChanged(object sender, EventArgs e)
{
if (State_DropDownList.SelectedItem.Text == "Bihar")
{
City_DropDownList.Items.Add("Patna");
City_DropDownList.Items.Add("Gaya");
City_DropDownList.Items.Add("Aurangabad");
}
}
protected void State_DropDownList__TextChanged(object sender, EventArgs e)
{
if (State_DropDownList.SelectedItem.Text == "Bihar")
{
City_DropDownList.Items.Add("Patna");
City_DropDownList.Items.Add("Gaya");
City_DropDownList.Items.Add("Aurangabad");
}
but these codes are not working please help me.
I do not want to use database for that.
modified 21-Sep-14 8:36am.
|
|
|
|
 |
enable autopostback option in dropdownlist (State_DropDownList) then check it will work
protected void State_DropDownList_SelectedIndexChanged(object sender, EventArgs e)
{
if (State_DropDownList.SelectedItem.Text == "Bihar")
{
City_DropDownList.Items.Add("Patna");
City_DropDownList.Items.Add("Gaya");
City_DropDownList.Items.Add("Aurangabad");
}
}
|
|
|
|
 |