weird Ajax ComboBox drop down list - asp.net

I've got combobox inside some panel :
<ajaxToolkit:ComboBox
ID="YearList"
runat="server"
OnInit="YearList_Init1"
EnableTheming="false"
Width="45px"
ViewStateMode="Disabled" />
and it was OK before I updated project to .NET 4 , after updating project (And AJAX) to .net4 it's looking like really strange ... I can't explain it proper , I will show :
how can I fix it ? :) Full CSS / ASPX page here -> https://github.com/nCdy/Issues/tree/master/Ajax%20ComboBox (string # 287)

I had a similar issue and could resolve mine by removing the extender that I had added to the Panel containing the combobox. I had used a DropShadowExtender for the Panel, removing it caused the combobox to be displayed perfectly. Perhaps you can try that as well.

i am seeing a lot of texts like
Контрактный час
:
, every where in your form. So i need to know, are you using some sort of encoding , that is, is this placed by you or came unexpectedly. If you havent placed it, remove all unneccessary such lines and use plain text instead (if required). Then check the layout.
Also in your image, i can see , ur language is russian(if i am right :)). So try using your localized font that is direcly supported by aspx as we use english or better use resource file instead of the hardcoded text on the page. As per my view the language conversion is creating such issue.

Related

Kentico ASPX+Portal templates not registering zones in database

In Kentico I'm using ASPX+Portal model created a template as a webform on disk with a single widget zone as follows:
<asp:Content id="content" runat="server" ContentPlaceHolderID="content">
<h1>Home: <%= this.PageModel.DisplayTitle %></h1>
<cms:CMSPagePlaceholder ID="plcZones" runat="server">
<LayoutTemplate>
<cms:CMSWebPartZone ID="zoneEditorContent" runat="server" ZoneTitle="Page content" WidgetZoneType="Editor" />
</LayoutTemplate>
</cms:CMSPagePlaceholder>
</asp:Content>
I then registered this in Kentico's Page templates module.
Pages using this template would now show the zone on the Page tab but wouldn't let me add widgets to it. I could browse the widget library, select a widget, set its properties, save and close the dialogue, but the page would refresh remaining empty.
After some dabbling I discovered that the relevant template record in database table [dbo].[CMS_PageTemplate] had its [PageTemplateWebParts] property set to the value '<page />'.
I discovered that changing this to '<page><webpartzone id="zoneEditorContent" v="1" widgetzonetype="editor" /></page>' resolved the problem. I could now add widgets to the zone on the Page tab.
My question is, what am I doing wrong here? I presume I'm not supposed to set this database field manually. Should Kentico be doing this automatically, and if so, what step am I missing to make this happen? I believe I've followed Kentico documentation accurately.
You are not doing anything wrong. I have to agree this is weird behavior but it is not possible (= does not take any effect) to set WidgetZoneType property in markup. You need to set it manually via admin UI (zone properties). If this is issue for you consider to add it to Kentico`s User voice.
YMHO I think you are right and it should be at least mentioned in doc that it is not possible to use this property in markup.
EDIT: My bad, please note it is mentioned in the docs, too:
Changing the WidgetZoneType property directly in layout code does not save the changes in the database. You need to set the Widget zone type property by configuring the zone properties.

Code Behind No Longer finds ID tags

I've been working on a website for several months now and am nearing my deadline. I know my methods are a little dated. Especially considering I still use tables. I've actually moved in a direction away from that, but this project is being produced from an excel spreadsheet and with more than 200 fields, it seems reasonable and the person I'm creating this for was happy to see the recreation.
Nevertheless, I am having an issue where I have declared an id for an asp TableCell and am trying to assign text to it. In the past this has worked. Literally every other page I have built has been able to accept this code.
Initially I had a textbox named "depthSingleUnit." With new data coming in, I realized I could combine the depth, height, and width information into one cell. And because I don't want the user to edit this data any longer, just view the information that's already available, I dropped the idea of using a textbox and just used the tablecell to display the information.
The tablecell now has an id "dimensionsSingleUnit"
<asp:TableCell columnspan="1" id="dimensionsSingleUnit"></asp:TableCell>
The code behind reads
dimensionsSingleUnit.Text = PONDS.Tables(0).Rows(0).Item("ProductDimensions")
Yet I get the error
Error 3 'dimensionsSingleUnit' is not declared. It may be inaccessible due to its protection level. C:\Users\aking\My. Documents\Visual Studio 2012\Projects\lampSpecs\lampSpecs\Factories\view.aspx.vb 289 4 lampSpecs
Am I missing something here? I have tried changing the id. I've tried creating a new tableCell with the same name. Tried creating a new tableCell with a different name. I tried creating a new file, but still have the same issue. I've tried re-building the project. I literally copy and paste the id into my code behind and that does not work.
The old ids from when I was using multiple cells for the data are still available, but all of the new ones that I've added will not display in intellisense and displays an error.
you need to add runat="server" to your html element to get access it from code page. because only runat="server" are available on the code behind page
Sorry meant to add as an answer....
Try
dimensionsSingleUnit.InnerHtml = PONDS.Tables(0).Rows(0).Item("ProductDimentiond")
I've not worked with tables cells in this way normally use gridviews or repeaters. It may be that a runat="server" for the table element is enough... but usually you need it for any html elements to be accessible from code

Printing a "tag" with a barcode using reporting services and DB values in asp.net

Edit 7 : I finally made it! Posted the answer.
Edit 6 : I scrapped the CSS and div and used a reporting services. Look at edits down the post to see where I am at right now.
I'm at a complete lost right now.
Sorry if I am not clear enough with my question, I can edit it to add information if needed. I'll try giving as much info as possible.
I've searched on google for hours now and havn't find anything to help me.
I am trying to create multiple "tag" using information on a user I have in my database and putting them on a page to print them. Plus, I need only 1 tag per page.
I got a stored proc that returns to me the username, name and family name as well as an ID I use to generate a barcode for every users in a certain event.
CREATE PROCEDURE Schema.GetAllTags
#IdEvent int
AS
BEGIN
SELECT Mem.Nom, Mem.Prenom, Mem.Pseudo, Use.IdUser
FROM Schema.User Use
JOIN Schema.Member Mem ON Use.IdMember = Mem.IdMember
WHERE Use.IdEvent = #IdEvent
END
The barcode is generated by calling an asp page and giving it the ID I received from my stored proc in the page parameter. The asp page is an image that I use to show my barcode in other pages.
I tried making the tags using divs, CSS, asp content and all that stuff and it worked... except for the printing part. The tag being resized all the time, the margin not being an inch even tho I tried everything to make it 25.4mm (1 inch) and on top of it, the url of the page always showing in the preview print. All thoses problem could be solved by the client simply from unchecking the show url and setting the margin yourself in the options. But I don't want to force the client to do theses in order to fix the problem. I want it to be 3 by 2 in, with 1 in margin and no url without having to change printing options.
I was told using reporting services would solve my printing problems. But I have no clues how to make what I need out of reporting services (I know what reporting services are mind you)... even less on how to get my barcode in there.
Here what the tag should look like in the end on a print page. 3in x 2in with 1in margin on top and left when printing.
Here the CSS I used to try and print my tag :
<style type="text/css">
#page
{
margin: 25.4mm 25.4mm 25.4mm 25.4mm;
}
#media print
{
body *
{
visibility:hidden;
}
#tagPrint, #tagPrint *
{
visibility:visible;
}
#tagPrint
{
position:fixed;
top: 0px;
left: 0px;
}
#NOPRINT
{
display:none;
}
}
And here the asp (That is for my page with only 1 tag showing) :
<asp:UpdatePanel ID="UpdatePanel1" runat="server" >
<ContentTemplate>
<div id="tag" class="formRow">
<div id="tagPrint" style="border:1px solid;width:76.2mm;height:50.8mm">
<p style="text-align:center" />
<br />
<asp:Label ID="lblUserTag" runat="server" style="font-weight:bold;font-size:18px" />
<br />
<asp:Label ID="lblFullNameTag" runat="server" style="font-weight:bold;font-size:16px" />
<br />
<br />
<asp:Image ID="imgBarcodeTag" runat="server" />
<br />
<asp:Label ID="lblIdTag" runat="server" style="font-weight:bold;font-size:16px" />
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
Currently generating my tags using a repeater on my page to generate multiple tags and binding the dataset.tables[0].Rows to the repeater. Allowing me to create thoses tags.
Is there any ways to do it without reporting services using only javascript and CSS?
Is it doable with reporting services (Using an asp page in a reporting service to make a barcode)? Since my barcode come from a font, is there any other way then adding the font on the compiter in order to use it in reporting services? (I don't want the client to have to install the font) Would making a pdf of the tag easier/better?
Edit : Started working around with a report service.
Right now I got the report made with 4 parameter. (Username, full name, barcode url and the ID)
I'll give update on what happens next.
Edit 2 : So... after managing to make a report service and showing it in the page. I can't seem to get my image to show on the report. And even if I did. I don't know how to make multiple page on the report or how to print it.
I decided to try making my Div Tag in PDF instead and try to print it that way. I'll update tomorrow when I get the chance to try it.
Edit 3 : Aside from wanting to smash my head on a wall several times, I tried doing it in PDF and it's not working. Found out it can probably be done in flash, but I do not want to do it in flash. So I'm back to the report service.
I made a report service with a grid where I send my dataset to the grid and put the datas in each fields. I installed the font to be able to use it in the report. Now I can't seem to bind my dataset to the report. I tried an SqlDataSource and ObjectDataSource and nothing seems to work. I started another report in a new project to try from scrap. Maybe something from my current project is playing against me.
I'm about to give up. -_-
Edit 4 : I finally made it to get something working. Got my report on my page working just fine.
Now only thing I have left to do... is manage to get the report to have multiple page.
Edit 5 : Rereading my edits and I realized I forgot to say that slightly after edit 2, I scrapped the parameters stuff and used a dataset instead. Also, I scrapped everything about CSS and the div to use a reporting service to save a PDF file of the tags.
So let me just preface this with a bit of explanation about SSRS: You're doing it all wrong.
By that I mean, if you're just trying to embed your ASP code and output in SSRS to achieve graphical fidelity, it's not going to happen.
The reason SSRS was recommended to you is because it can take a set of data and reproduce it with high graphic fidelity in a variety of reporting styles, formats, and output methods.
But you have to build it from scratch. No HTML, no CSS, no ASP, no .Net (well .. sort of. For you, yes, no .Net required.)
Whoa, whoa, whoa, where you going? It's not that hard, I promise.
So ... first, let's just set up a task list for you to do this in SSRS. Before we can even do that, let's just build a wizard-driven report so we can get your ID tag data set into the report. It'll give you a basic feel for how SSRS consumes data and turns it into a report.
Create a brand-new Reporting Services project.
Add a new report to this project. In the Solution Explorer, right click on the Reports folder and "Add New Report."
Step one is select the data source. Hook it up to your database with the stored procedure you're running, test your connection, moving on.
Next step is to Design the Query - but you've already done that with your Sproc, so just paste that in - for now, add a hardcoded value for your IdEvent. We'll fix that later.
Now choose your report type - let's just do Tabular for now. Matrix is more for lots of row/column dynamics, and you're just looking for a simple printable report, so table for you.
Now in designing the table, just add all of your output columns to the Detils group.
Choose any old Table style, you're throwing this all away in the end.
Name your report something useful and finish.
Now you've got a RDL, it's got a data source, a data set, and some code in the designer area. You can preview what you've done so far by clicking the "Preview" tab in the designer area. Pretty sweet, there's all your data, in little rows in a table. Now what?
Now for the task list. Start Googling, you can learn all of this, it won't take too long, and when you're done, you'll have a well-formatted set of ID tags ready for the printer. And if you run into specific issues - well, that's what this site is for, right?
Create a parameter to pass in your IDEvent to your stored procedure.
Insert a dynamic external image into the row that retrieves the barcode from your ASP page. (Hint: read up on using "Expressions" in SSRS.)
Figure out how to use the page break options in SSRS to only print 1 tag per page.
Use the properties window to format each "row" of your table to look like your tag.
Figure out whether to export your report as a PDF, or just use the MHTML version provided.
You might also potentially want to learn how to embed an SSRS report in a .Net application (how are you clients printing the tags, anyway?) And of course there are tons of little methods, properties, and aspects of SSRS that are out of scope for this particular task but might be worth at least taking a look at for later projects.
Good luck!
Finally! I made it!
Here what I did.
Made a SSRS.
Made a report viewer and ObjectDataBinder
Create a DataSet for the SSRS using my stored proc.
Bound the report viewer to the SSRS.
Play around the SSRS to place the fields like they need to be placed.
Set page margin in SSRS to 1 inch. Set the report to 3x2 inch.
Set the report size to 5x4 inch.
Tested and enjoyed my victory over theses hours of frustration.
Note : It took me lot of time because visual studio bugged on me and I had to delete and redo my SSRS entirely.
Result :
A beautiful PDF file with perfect size, margin that print perfectly WITH a codebar. VICTORY!

why are the first characters in my asp login labels in italics?

I can't work out why the first characters of all the labels on my asp login forms are showing in italics:
The code looks like this:
<asp:login DestinationPageUrl="blah.aspx" runat="server" usernamelabeltext="Email Address" ></asp:login>
When I inspect it using firebug it shows that the first characters are being enclosed in tags, like so:
<label for="ctl00_ctl00_ctl00_ContentPlaceHolderDefault_wwContentArea_ctl03_UserName">
<em>E</em>
mail Address
</label>
...
<label for="ctl00_ctl00_ctl00_ContentPlaceHolderDefault_wwContentArea_ctl03_Password">
<em>P</em>
assword:
</label>
Does anyone know what may be causing this? I thought it might have been something to do with access keys (if I press alt+e then it focuses to the email text box) but I cant work out how to stop this.
For me, it was because I was using the CSS Friendly Control Adapters. Since my primary motivation for installing them was for the menu control adapter, I've disabled the login control adapter.
Open the CSSFriendAdapters.browser in the App_Browsers folder.
Comment out the LoginAdapter, like so:
<!--<adapter controlType="System.Web.UI.WebControls.Login" adapterType="CSSFriendly.LoginAdapter" />-->
There's probably a way to get the advantages of the CSS adapter without the italics.
I can't answer why it was doing it, but I've managed to work around it.
With the line of code still as follows:
<asp:login DestinationPageUrl="/schools/what-works/whatworkssearch.aspx" runat="server" usernamelabeltext="Email Address"></asp:login>
This is what the control looked like in designer view:
Although there are no italics shown, it was being rendered with the first characters in italics as I described in my question. To get around this I converted the control to a template like so:
This created a template that shows the labels for the login fields and therefore I could remove the italics tags.
Although this doesn't answer why it was behaving like this for the single line of code, it shows how to get around it.
You may want to check the AccessKey property of the login control and the individual controls pasted within the login section such as Label, TextBox and buttons. By removing the AccessKey value should fix the issue.

Dynamically adding style to form ? Using Asp.net?

In web application, I am trying to add style to form, I write like this :
form1.Attributes.CssStyle.Add ("style","background:url(nEWmOSIACH.jpg)");
but i am not getting any image, can you help me.
Verify the generated html and, most importantly, the given path using dev tools in your browser. This should be working. My guess is a wrong path to the image...
i got it , i write the code in form oninit event , now it is coming.

Resources