Showing posts with label hii. Show all posts
Showing posts with label hii. Show all posts

Saturday, March 24, 2012

My host havent got Ajax

Hi;

I want to use Ajax (codename atlas) , my project is working in my computer but my host isn't work (because my host havent got Ajax Confused )

my hosting administrator doesnt allow for setup ajax

What can I do ?please help

THANKS

Sel?uk Ak

Add the needed assemblies to your Bin folder.

Which file I must add \bin directory for standart using ?

Thanks


For RC 1 add: System.Web.Extensions.dll & System.Web.Extensions.Designer.dll usally located C:\Program Files\Microsoft ASP.NET\ASP.NET 2.0 AJAX Extensions\v1.0.61025 and if you are using the toolkit you must also add: AjaxControlToolkit.dll and this is located where ever the samplewebsite is that came with the Control Toolkit.

I can't found System.Web.Extensions.dll but in this directory (:\Program Files\Microsoft ASP.NET\ASP.NET 2.0 AJAX Extensions\v1.0.61025)

I found microsoft.web.extensions.dll and other so I copy this file to my web aplication from the host but after that I take this mistake :(

What Can I do

Thanks

Configuration Error

Description:An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

Parser Error Message:Could not load file or assembly 'Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.

Source Error:

Line 37: <compilation debug="true">Line 38: <assemblies>Line 39: <add assembly="Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>Line 40: <add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/></assemblies>Line 41: </compilation>


Source File:C:\Inetpub\vhosts\osozluk.com\httpdocs\osozluk\web.config Line:39

Assembly Load Trace: The following information can be helpful to determine why the assembly 'Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' could not be loaded.

WRN: Assembly binding logging is turned OFF.To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.Note: There is some performance penalty associated with assembly bind failure logging.To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].



Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.210


You're not using the latest version. See here: http://ajax.asp.net/files/AspNet_AJAX_CTP_to_RC_Whitepaper.aspx

I uninstall ajax Ctp and setup new versiyon after I want try new ajax so I make new project ,in this projet there are only one button and a label

when I click buton label text is change, this project is working my computer but when I copy my host still this is not working (and also I make bin directory and copy System.Web.Extensions.dll ,System.Web.Extensions.Design.dll )

I take this mistake again and againSuper Angry

------------------------------------------------------------

Configuration Error

Description:An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

Parser Error Message:Could not load file or assembly 'System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.

Source Error:

Line 37: <compilation debug="true">Line 38: <assemblies>Line 39: <add assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>Line 40: </assemblies>Line 41: </compilation>


Source File:C:\Inetpub\vhosts\osozluk.com\httpdocs\ajaxyeni\web.config Line:39

Assembly Load Trace: The following information can be helpful to determine why the assembly 'System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' could not be loaded.

WRN: Assembly binding logging is turned OFF.To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.Note: There is some performance penalty associated with assembly bind failure logging.To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].



Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.210

Navigation using Master pages and Update panel without refresh

Hi

I have a master page in which there are hyperlinks to go to different pages. Its a header basically. I got the relevant content pages for the hyperlinks.

But when I click the master page links, a postback occurs and the whole page is refreshed and directed to the new page.

I need a way by which when I click the hyperlinks in master page the content pages change without any refreshing. I heard about the Iframe implementaion in update panel is it a feasible way to do this or multiview might solve my problem ?

Having a master page sort of defeats the purpose of keeping the same page and dynamically updating portions on postback. The master page is meant to be a supplement for the page the user is viewing. This means the master page is never browsed directly, it only contains master code for each of the pages that are browsed to directly.

Also, hyperlink controls should not perform postbacks -- they are simply meant for navigation. Therefore, anytime a user clicks a hyperlink, the user will be taken to the new page, causing flicker. I suggest using a link button instead. These perform postbacks and can capture events much better than a hyperlink.

In order to do what you're trying to do, consider not using a master page. Instead, use a single page that makes use of either an iframe or a multiview enclosed in an updatepanel. Example is below:

<htmlxmlns="http://www.w3.org/1999/xhtml">
<headrunat="server">
<title>Untitled Page</title>
</head>
<body>
<formid="theForm"runat="server">
<divid="wrapper">
<asp:ScriptManagerID="scriptManager"runat="server"></asp:ScriptManager>
<divid="header">
<asp:LinkButtonID="lnkClickMe"runat="server"OnClick="lnkClickMe_Click">Click Me!</asp:LinkButton>
</div>
<asp:UpdatePanelID="pnlDynamicContent"runat="server"UpdateMode="Conditional">
<ContentTemplate>
<asp:MultiViewID="mvDynamicContent"runat="server"ActiveViewIndex="0">
<asp:ViewID="viewBeforeClick"runat="server">
This is before the link above is clicked
</asp:View>
<asp:ViewID="viewAfterClick"runat="server">
This is after the link above is clicked
</asp:View>
</asp:MultiView>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTriggerControlID="lnkClickMe"EventName="Click"/>
</Triggers>
</asp:UpdatePanel>
</div>
</form>
</body>
</html>

And the code-behind:

PartialClass Test_ForumTest
Inherits System.Web.UI.Page

ProtectedSub lnkClickMe_Click(ByVal senderAsObject,ByVal eAs EventArgs)
mvDynamicContent.ActiveViewIndex = 1
EndSub
EndClass


Convert your hyperlink to linkbuttons then register these buttons as AsyncTrigger in the Update Panel. Convert Your Content Pages to User Control. Load the Proper User Control on Button Click.

Wednesday, March 21, 2012

Need help designing a drag-drop resulting in a formatted output to the user

Hi

I have a request from a customer regarding a drag-drop-edit feature.

This is the idea:

An editor of a website must enter data to show for the web-site user. He has a fixed number of elements that can be used, most of which will be positioned the same place on every page, but a few can vary and some can be added multiple times (this is decided based on the database using relations). The editor would like to be able to have some sort of toolbox feature on his "Create journal", from this toolbox he can drag out elements, such as date, journal number, description, resume etc. When an item is dragged out on the "workspace" he can then enter the data that should go in that field, meaning the description box should be considerebly larger than the date box as example. When the editor has added all the elements to the journal he can save it and it is now visible on the website. The website visitors can now see the journal formatted the way the editor defined it.

I haven't worked alot with AJAX before, so I would like to hear if this is something AJAX can help me solve? If so links to usefull sites would be very welcomeSmile

Hi,

Thank you for your post!

Seehttp://forums.asp.net/t/1187961.aspx

Here is a simple demo to combine pictures at server side in C#:

using System;
using System.Collections.Generic;
using System.Collections;
using System.Text;
using System.Drawing;
using System.Drawing.Imaging;
using System.Drawing.Drawing2D;

namespace Enter_name
{
class GenerateImage
{
public struct favoriteImage
{
private string _imagePath;
private int _x;
private int _y;

public int x
{
get
{
return _x;
}
set
{
_x = value;
}
}

public int y
{
get
{
return _y;
}
set
{
_y = value;
}
}

public string imagePath
{
get
{
return _imagePath;
}
set
{
_imagePath = value;
}
}
}

[STAThread]
static void Main(string[] args)
{
string CurrentDirectory = System.Environment.CurrentDirectory;
string body_path = CurrentDirectory + "\\4.jpg";

favoriteImage[] FaImage = new favoriteImage[2];

FaImage[0].x = -3;
FaImage[0].y = 70;
FaImage[0].imagePath = CurrentDirectory + "\\1.jpg";

FaImage[1].x = 20;//65;
FaImage[1].y = -12;
FaImage[1].imagePath = CurrentDirectory + "\\2.jpg";

generateWinterMark(CurrentDirectory, body_path, FaImage);
}

/// <summary>
///
/// </summary>
/// <param name="savePath"></param>
/// <param name="body_path"></param>
/// <param name="favorite"></param>
/// <returns></returns>
private static string generateWinterMark(string savePath, string body_path, favoriteImage[] favorite)
{
//create a image object containing the photograph to watermark
Bitmap imgPhoto = new Bitmap(body_path);
int phWidth = imgPhoto.Width;
int phHeight = imgPhoto.Height;


string nowTime = DateTime.Now.Year.ToString() + DateTime.Now.Month.ToString() + DateTime.Now.Day.ToString();
nowTime += DateTime.Now.Hour.ToString() + DateTime.Now.Minute.ToString() + DateTime.Now.Second.ToString();

string saveImagePath = savePath + "\\FA" + nowTime + ".jpg";

//create a Bitmap the Size of the original photograph
Bitmap bmPhoto = new Bitmap(phWidth, phHeight, PixelFormat.Format24bppRgb);
//setResolution
bmPhoto.SetResolution(imgPhoto.HorizontalResolution, imgPhoto.VerticalResolution);

//load the Bitmap into a Graphics object
Graphics grPhoto = Graphics.FromImage(bmPhoto);
//set the rendering quality for this Graphics object
grPhoto.SmoothingMode = SmoothingMode.AntiAlias;

for (int i = 0; i < favorite.Length; i++)
{
//Draws the photo Image object at original size to the graphics object.
grPhoto.DrawImage(
imgPhoto, // Photo Image object
new Rectangle(0, 0, phWidth, phHeight), // Rectangle structure
0, // x-coordinate of the portion of the source image to draw.
0, // y-coordinate of the portion of the source image to draw.
phWidth, // Width of the portion of the source image to draw.
phHeight, // Height of the portion of the source image to draw.
GraphicsUnit.Pixel); // Units of measure

//------------------
//Step #2 - Insert Property image,For example:hair,skirt,shoes etc.
//------------------
//create a image object containing the watermark
Bitmap imgWatermark = new Bitmap(favorite[i].imagePath);
int wmWidth = imgWatermark.Width;
int wmHeight = imgWatermark.Height;
imgWatermark.MakeTransparent(); //使默认的透明颜色对此 Bitmap 透明。


//Create a Bitmap based on the previously modified photograph Bitmap
Bitmap bmWatermark = new Bitmap(bmPhoto);

//bmWatermark.SetResolution(imgPhoto.HorizontalResolution, imgPhoto.VerticalResolution);
//Load this Bitmap into a new Graphic Object
Graphics grWatermark = Graphics.FromImage(bmWatermark);


int xPosOfWm = favorite[i].x;
int yPosOfWm = favorite[i].y;

//叠加
grWatermark.DrawImage(imgWatermark, new Rectangle(xPosOfWm, yPosOfWm, wmWidth, wmHeight), //Set the detination Position
0, // x-coordinate of the portion of the source image to draw.
0, // y-coordinate of the portion of the source image to draw.
wmWidth, // Watermark Width
wmHeight, // Watermark Height
GraphicsUnit.Pixel, // Unit of measurment
null); //ImageAttributes Object


//Replace the original photgraphs bitmap with the new Bitmap
imgPhoto = bmWatermark;//age(FromHbitmap(bmWatermark;

grWatermark.Dispose();
imgWatermark.Dispose();
}
bmPhoto.Dispose();
grPhoto.Dispose();

//save new image to file system.
imgPhoto.Save(saveImagePath, ImageFormat.Jpeg);
imgPhoto.Dispose();

return saveImagePath;
}
}
}

The demo show you that conbine 1.png and 2.png towhite.png.

Happy coding!

need help for UpdatePanel

Hi

I created one page with AJAX.Net. My page is as follow. It is working fine. but When I click on Save button It save the data into the database and reset the Controls value[using ResetControls() methods]. this method is fired but it is not reset the controls value. I do not know why? Can Any body help me? I put my .aspx and Save button event.

<

asp:ScriptManagerID="ScriptManager1"runat="server"EnablePartialRendering="true"></asp:ScriptManager>

<

asp:UpdatePanelID="UpdatePanel1"runat="server">
<ContentTemplate>

<tablecellspacing="0"cellpadding="2"width="97%"border="0"align="center">
<tr><tdalign="right"style="height: 28px"width="18%"></td><tdstyle="height: 28px"width="2%"></td><tdclass="ItemDetail"style="height: 28px"width="80%">
<asp:LabelID="lblMessage"runat="server"SkinID="errorLable"></asp:Label></td></tr></table>

</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTriggerControlID="btnSave"EventName="Click"/>
</Triggers>

</asp:UpdatePanel>

<tablecellspacing="0"cellpadding="2"width="97%"border="0"align="center">
<tr><tdwidth="18%"style="height: 28px"align="right"><asp:LabelID="lblDate"runat="server"Text="Date"SkinID="requiredLabel"></asp:Label></td>
<tdwidth="2%"style="height: 28px"> </td><tdwidth="80%"class="ItemDetail"style="height: 28px">
<asp:TextBoxID="txtDate"runat="server"Columns="15"MaxLength="12"></asp:TextBox>
<asp:Imagerunat="Server"ID="Image1"ImageUrl="~/images/cal.gif"ToolTip="Click to show calendar"style="border-width:0px;"DescriptionUrl="#"/>
<cc1:CalendarExtenderID="CalendarExtender1"runat="server"Format="MMMM d, yyyy"TargetControlID="txtDate"BehaviorID="CalendarExtender1"PopupButtonID="image1">
</cc1:CalendarExtender>
</td></tr><tr><tdalign="right"><asp:LabelID="lblSpeaker"runat="server"Text="Speaker"SkinID="requiredLabel"></asp:Label></td><td> </td><tdclass="ItemDetail">
<asp:TextBoxID="txtSpeakerName"runat="server"Columns="30"MaxLength="50"></asp:TextBox></td></tr>

<tr><tdalign="right"><asp:LabelID="lblTopic"runat="server"Text="Topic"></asp:Label> </td><td> </td><tdclass="ItemDetail">
<asp:TextBoxID="txtTopic"runat="server"Columns="45"MaxLength="100"></asp:TextBox></td></tr
<tr><tdvalign="top"align="right"><asp:LabelID="lblComments"runat="server"Text="Comments"></asp:Label> </td><td> </td><tdclass="ItemDetail">
<tablecellpadding="2"cellspacing="0"border="0"><tr><td>
<FTB:FreeTextBoxID="txtComments"runat="server"AllowHtmlMode="True"BreakMode="LineBreak"
ButtonSet="OfficeXP"ConvertHtmlSymbolsToHtmlCodes="True"DisableIEBackButton="True"Height="175px"SupportFolder="/CRRoot/FreeTextBox/"ToolbarLayout="ParagraphMenu,FontFacesMenu,FontSizesMenu,FontForeColorsMenu|Bold,Italic,Underline,Strikethrough;Superscript,Subscript,RemoveFormat|JustifyLeft,JustifyRight,JustifyCenter,JustifyFull;BulletedList,NumberedList,Indent,Outdent;CreateLink,Unlink,InsertImage,InsertRule|Cut,Copy,Paste;Undo,Redo,Print,InsertImageFromGallery"></FTB:FreeTextBox> </td></tr></table></td></tr
<tr><tdclass="ItemHeading"valign="top"align="right"></td><td></td><tdclass="ItemDetail"></td></tr
<tr><tdcolspan="3"class="CommandBar"> <asp:ButtonID="btnSave"runat="server"Text=" Save "OnClick="btnSave_Click"AccessKey="S"/>
<asp:ButtonID="btnCancel"runat="server"Text=" Cancel "CausesValidation="False"OnClick="btnCancel_Click1"AccessKey="C"/></td></tr
</table
===============================

protectedvoid btnSave_Click(object sender,EventArgs e){

string Errors = validation();
if (Errors.Length > 0)
{
lblMessage.Text = Errors;
lblMessage.Visible =true;
return;}DateTime SpeakerDate =DateTime.Today;
DateTime.TryParse(txtDate.Text.Trim(),out SpeakerDate);
string SpeakerName = txtSpeakerName.Text.Trim();
string Topic = txtTopic.Text.Trim();
string Comments = txtComments.Text.Trim();
string Action = ((Utilities.ProcessStatus)this.ProcessMode).ToString();
int Success =Speaker.SpeakerAddEditDelete(CookiesInfo.ClubId,this.SpeakerId, SpeakerDate,
SpeakerName, Topic, Comments, Action);
if (Success == -1)
{
lblMessage.Text =" - Record has not been saved. Please check the inputs.";
lblMessage.Visible =true;
}else{
ResetControls();
lblMessage.Text =" - Record has been saved successfully.";
lblMessage.Visible =true;
}
}privatevoid ResetControls(){

txtDate.Text =String.Format("{0:MMMM d, yyyy}",DateTime.Today);
txtSpeakerName.Text =string.Empty;
txtComments.Text =string.Empty;
txtTopic.Text =string.Empty;

}

The textboxes are not part of the UpdatePanel's ContentTemplate.

hence , inaccessible from the server.

Move them inside the UpdatePanel and they will be accessible .

Hope this helps

need help with page_load

Hi

I am new to development so i hope my question is not silly for you.I have developed a web page and there is user login part in an update panel.I check the session["status"] on page load and if it is true change the visibility of update panel to false and make the "welcome ..." lable visible. It works perfectly at first time but after page changing update panel became visible with the input textboxes again! In debug I have observed that the code do not enter the page load..While the screen that update panel and input textboxes are visible when I hit the (F5) to refresh the page update panel becomes invisible and "welcome ..." label becomes visible..So I thougth that it is a certain problem of Page_Load...

Is there any suggestion or solve method for this? Is my method for logging in is wrong for Ajax?

Thanks for concerning

Help needed please,it is urgent:(