|
cud u plz explain in detail? i wud be thankful if u cud send me any link(url) where i can get more idea.
|
|
|
|
|
You may have a table called "tblAdvertisement" where you are storing all advertisements. This is the table from which you are also showing advertisments in the page. Now add a seperate column (of datetime type) called "validTillDate" column. Whenever you are inserting any record in the "tblAdvertisement", put a "validTillDate" for the advertisement. "validTillDate" simply stores the date till the advertisement will be valid and active.
When you are going to show advertisments on the page, check all advertisements' "validTillDate" column pick only those advertisement whose "validTillDate" column value is less than or equal to the current date. It will be best if you can check it in the sql statement itself. Just checkout the sample sql query:
select * from tblAdvertisement where validTillDate <= getdate()
I think this explanation should be enough for you to get started. There is no link and url that I can give to you as there is more logic invloved than coding. In case of any issue, revert back to us.
Regards
Saanj
There is no foolish question, there is no final answer...
|
|
|
|
|
Hi I am Chinmay , i am using telerik Rad controls in my projects.
Problem : -
I have two fields in telerik radgrid. one is a readonly textbox with datetime value . other is a editable RadDateTimePicker.
Requirement - Whenever I change/select a date from RadDateTimePicker it should check whether the selecteddatetime is greater than the value present in the readonly textbox and popup a window with a simple message . All this we have to achieve through javascript and the validation should takes place as soon as we select a new value from RadDateTimePicker
I tried with SelectedDateChanged event of RadDateTimePicker but I am unable to access the javascript method attached to this event.
Can you please help me and if possible can you please post a sample code to achieve the requirement.
Thanks in advance.
|
|
|
|
|
Hi,
I have a folder on the server with a web sharing permission.
if i add the Built-in security principals(Network) for sharing permission, i can use the scripting.fileobjectsystem to copy file from client to that folder. but the problem that i can access that folder from client. when i remove this permission then i cannot access the folder from client but also i cannot copy file using scripting object.(access denied exception)
Any idea ??
Regards
dghdfghdfghdfghdgh
|
|
|
|
|
Below is the add and get cache methods; however, the get method doesn't return any value. I have insured that the key (sessionID) is valid when calling both. Can someone help?
public Object GetCacheItem(string key)
{
return HttpRuntime.Cache.Get(key);
}
public void AddCacheItem(string key, Object value)
{
HttpRuntime.Cache.Add(key, value, null, DateTime.Now.AddMinutes(20), Cache.NoSlidingExpiration,
CacheItemPriority.Default, null);
}
Thanks,
Steve
|
|
|
|
|
I only ever access the cache item like:
object sessionObj = HttpRuntime.Cache[key];
'Get' sounds like it would do the same but I'm not certain.
|
|
|
|
|
Hi all,
I have just started using Ajax controls toolkit.
Now i have a couple of questions:
1) Can we write javascripts for user controls?
2) Can i add user controls to a web page which uses AJAX Toolkit controls?
The problem that i am facing is, whenever i add the register tag in the page to register the user control, Visual studio hangs and further my machine does not responds, i have to restart the machine.
I don't know what is causing this....
Please if someone cud answer the above questions and also tell me how do i add the usercontrol on a page.
Thanks & Regards,
Pramod
"Everyone is a genius at least once a year"
|
|
|
|
|
Yadav Pramod wrote: Can we write javascripts for user controls?
Of course.
Yadav Pramod wrote: Can i add user controls to a web page which uses AJAX Toolkit controls?
Also, of course.
ASP.NET is just an engine for HTML and javascript. The end page does not care where the script came from . If you can't write your own AJAX, if you must let the toolkit do it for you, then you probably need to take some care not to stomp what it does with your script, that's the risk of using a black box. But, there's no reason you can't do it, and probably little chance you'll break anything.
Yadav Pramod wrote: and also tell me how do i add the usercontrol on a page.
The same way you always have. You're surely not playing with the AJAX toolkit prior to knowing how to define your own control ?
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
I am using this xml file to upload Product.
<?xml version="1.0" encoding="utf-8"?>
<AmazonEnvelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://images-na.ssl-images-amazon.com/images/G/01/rainier/help/xsd/release_1_9/Product.xsd">
<Header>
<DocumentVersion>1.01</DocumentVersion>
<MerchantIdentifier>M_WIDECOMMER_6058020</MerchantIdentifier>
</Header>
<MessageType>Product</MessageType>
<Message>
<MessageID>1</MessageID>
<Product>
<SKU>njkhjhjdghjb</SKU>
<Condition>
<ConditionType>New</ConditionType>
</Condition>
<DescriptionData>
<Title>tedy</Title>
<Brand>ProductBrand</Brand>
<Description>ProductDescription</Description>
<BulletPoint>Product Feature 1</BulletPoint>
<BulletPoint>Product Feature 2</BulletPoint>
<BulletPoint>Product Feature 3</BulletPoint>
<ItemDimensions>
<Length unitOfMeasure="MM">10</Length>
<Width unitOfMeasure="MM">11</Width>
<Height unitOfMeasure="MM">12</Height>
<Weight unitOfMeasure="KG">4</Weight>
</ItemDimensions>
<Manufacturer>2009</Manufacturer>
<MfrPartNumber>ProductPartNumber</MfrPartNumber>
</DescriptionData>
<ProductData>
<Home>
<ProductType>
<BedAndBath>
<ColorMap>beige</ColorMap>
<IsStainResistant>true</IsStainResistant>
<Material>Material1</Material>
<NumberOfSets>1</NumberOfSets>
<ThreadCount>1</ThreadCount>
<VariationData>
<VariationTheme>Size</VariationTheme>
<Size>Size1</Size>
<Color>Color1</Color>
<Scent>Scent1</Scent>
</VariationData>
<Wattage>1</Wattage>
</BedAndBath>
</ProductType>
<Parentage>collection-parent</Parentage>
<CountryProducedIn>CountryProducedIn1</CountryProducedIn>
<PatternName>PatternName1</PatternName>
<StyleName>StyleName1</StyleName>
<Occasion>Occasion1</Occasion>
<MatteStyle>MatteStyle1</MatteStyle>
<DisplayLength unitOfMeasure="MM">1</DisplayLength>
<DisplayWidth unitOfMeasure="MM">1</DisplayWidth>
<DisplayHeight unitOfMeasure="MM">1</DisplayHeight>
<DisplayDepth unitOfMeasure="MM">1</DisplayDepth>
<DisplayDiameter unitOfMeasure="MM">1</DisplayDiameter>
<DisplayWeight unitOfMeasure="GR">1</DisplayWeight>
<ItemPackageQuantity>1</ItemPackageQuantity>
<ManufacturerWarrantyDescription>ManufacturerWarrantyDescription</ManufacturerWarrantyDescription>
<VolumeCapacity unitOfMeasure="cubic-cm">1</VolumeCapacity>
<NumberOfPieces>1</NumberOfPieces>
</Home>
</ProductData>
</Product>
</Message>
</AmazonEnvelope>
And I am taking Xsd from "https://images-na.ssl-images-amazon.com/images/G/01/rainier/help/xsd/release_1_9/Product.xsd[^]"
And using this code to send feed
request.FeedContent = File.Open(Server.MapPath("XmlFeed/Product.xml"), FileMode.Open, FileAccess.Read);
request.ContentMD5 = MarketplaceWebService.MarketplaceWebServiceClient.CalculateContentMD5(request.FeedContent);
request.FeedContent.Position = 0;
request.FeedType = "_POST_PRODUCT_DATA_";
ClsMWS.InvokeSubmitFeed(service, request);
request.FeedContent.Close();
Trough this Xsd data cannot send to amazon. its working for xml but not for xsd.
Plese help me to resolve this problem
|
|
|
|
|
Since this is related to a third party API, this won't be the right place for this question. Please try the amazon developer forums.
|
|
|
|
|
Hi Guys,
i am a bit new to ASP .net web development.
I have created a user control and placed some radio buttons,
now i want to call a javascript function on the OnCheckedChanged event of the radio button.
I googled but to no use.
Also on my web page if i try to call a javascript it gives me error.
Can anyone please tell me the correct way to call javascript in both the cases.
Thanks in advance,
Thanks & Regards,
Pramod
"Everyone is a genius at least once a year"
|
|
|
|
|
Solution for
OnCheckedChanged event of the radio button.
check with ClientScript.RegisterClientScriptBlock
e.g.[ some pseudo code]
public void ShowMessage(string input) {
string strScript = String.Empty;
strScript =@"<script language=javascript> ";
strScript = strScript + "alert('"+input+"')";
strScript = strScript + @"</script>";
RegisterClientScriptBlock("clientScript", strScript);
}
protected void rdButton_OnCheckedChanged(object sender, EventArgs e)
{
ShowMessage("Niladri Showed a way to solve the problem");
}
Check for the next part, add <pre><script language="javascript" type="text/javascript"></pre>
If not you are making any mistake it is guarented to work.
Vote please
Niladri Biswas
|
|
|
|
|
Yadav Pramod wrote: now i want to call a javascript function on the OnCheckedChanged event of the radio button.
OnCheckedChanged is a server side event and fires only when AutoPostBack is turned on. So hooking a JS function from here is pointless. I guess you want to call a JS function when someone clicks on the CheckBox , right?
Use the Attributes[^] property to add a onClick attribute. Something like
YourCheckBox.Attributes.Add("onClick","JsFunction();")
Do this on the page load, so that your checkbox renders with this attribute and JsFunction() will get called when user clicks on the checkbox.
|
|
|
|
|
Thanks Navaneeth,
Have u ever worked on user controls and AJAX toolkit?
Thanks & Regards,
Pramod
"Everyone is a genius at least once a year"
|
|
|
|
|
hello
Can anybody tell me how to bind morethan two tables to grid view
I want to add items from one table and
can add year and month value from another tables
|
|
|
|
|
Are you talking about tables in a database or tables in a DataSet?
In the database you can join the tables together use SQL to produce a single result set.
Man who stand on hill with mouth open wait long time for roast duck to drop in
|
|
|
|
|
First of all the question itself is not clear.
Case I
Assuming that it is database table
Solution
Produce a single resultset by aplying join or any other condition based on your demand
Case II
Assuming it is DataTable
Solution
Create a custom datatable table that will have all the fields.
Fill the table programatically and then make it as the datasource of your grid view
e.g. [ Some rough pseudo code]
Datatable dt1 = new Datatable();
dt1.Columns.Add(Col1);
dt1.Columns.Add(Col2);
dt1.Rows.Add("Val1","Val2");
dt1.Rows.Add("Val3","Val4");
Datatable dt2 = new Datatable();
dt2.Columns.Add(Year);
dt2.Columns.Add(Month);
dt2.Rows.Add("2001","Jan");
dt2.Rows.Add("2002","Feb");
Datatable dtFinal = new Datatable();
dtFinal .Columns.Add(Col1);
dtFinal .Columns.Add(Col2);
dtFinal .Columns.Add(Year);
dtFinal .Columns.Add(Month);
dtFinal .Rows.Add("Val1","Val2","2001","Jan");
dtFinal .Rows.Add("Val3","Val4","2002","Feb");
myDatagrid.DataSource = dtFinal;
myDatagrid.DataBind();
Hope this helps
vote please
Niladri Biswas
modified on Saturday, June 13, 2009 11:07 AM
|
|
|
|
|
Bandanenilima wrote: I want to add items from one table and
can add year and month value from another tables
If your both datatables follow same structure, you can use DataTable.Merge[^]. But it looks like you have different structure. Obvious method would be to get a single data structure which has all the data required for binding.
|
|
|
|
|
Hi,
In a multiline textbox control that i added a user can keep typing on the first line without pressing enter on newline character.
How can i force the user to press the 'enter' button or automatically take the user to the newline once the boundary
of the textbox is reached.
the problem i am facing is that when the user saves the content and the page is refreshed, then the whole article is displayed in one line only and the breadth of the textbox is unimaginable. It just keeps going to the right side.
Thanks,
NetQuestions
|
|
|
|
|
The text box has built in word wrapping. It would appear that on the postback you are setting the width of the text box to be the number of characters in the Text property or allowing something else do that for you. Don't do that.
Man who stand on hill with mouth open wait long time for roast duck to drop in
|
|
|
|
|
NetQuestions wrote: How can i force the user to press the 'enter' button or automatically take the user to the newline once the boundary
of the textbox is reached.
When user types text and reaches the right end of textbox, it usually takes you to the next line automatically. Are you saying the text entered by user is not getting displayed as it is when page is refreshed? Textbox adds \n to each line and you have to replace this with <br> when displaying. Also replace spaces with . Browsers don't understand \n or white spaces.
|
|
|
|
|
how to set multilingual setting to a whole website or to
many webpages
i hav set multilingual setting in only one page
i want it to apply to whole page
the code is
|
|
|
|
|
All the thing is is depends on your web site structure.
- Provide the supported language list on your Page header are
- When end use choose any language from the list then save the selected language into Cookies or session object.
- As you are doing for one page use the selected language on every pages.
Please let me know if your requirement is different or your way of implementation is other.
|
|
|
|
|
my code is like tis
tis code works on the same page only i want to set the language setting in all pages.....
Imports System
Imports System.Globalization
Imports System.Threading
Imports System.Resources
Imports System.Reflection.AssemblyName
Imports System.IO
Partial Class Testmultiligual
Inherits System.Web.UI.Page
Private rm As ResourceManager
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
con.ConnectionString = ConfigurationManager.ConnectionStrings("ESCConnection").ConnectionString
Dim ci As CultureInfo
If Not Page.IsPostBack Then
gridbind()
Thread.CurrentThread.CurrentCulture = New CultureInfo("en-US")
'get the culture info to set the language
rm = New ResourceManager("Resources.Strings", System.Reflection.Assembly.Load("App_GlobalResources"))
ci = Thread.CurrentThread.CurrentCulture
LoadStrings(ci)
Else
'get the culture info to set the language
rm = New ResourceManager("Resources.Strings", System.Reflection.Assembly.Load("App_GlobalResources"))
ci = Thread.CurrentThread.CurrentCulture
LoadStrings(ci)
End If
End Sub
Private Sub LoadStrings(ByVal ci As CultureInfo)
HylEdit.Text = rm.GetString("Add", ci)
BtnClear.Text = rm.GetString("Clear", ci)
BtnSave.Text = rm.GetString("Save", ci)
HylView.Text = rm.GetString("View", ci)
TDAwd.InnerText = rm.GetString("Awd", ci)
TDAwdDes.InnerText = rm.GetString("Awddes", ci)
TDAwdpic.InnerText = rm.GetString("Awdpi", ci)
TDFreq.InnerText = rm.GetString("Freq", ci)
TDAwdcri.InnerText = rm.GetString("Awdcri", ci)
TDAwdSt.InnerText = rm.GetString("AwdSt", ci)
TDAwdk.InnerText = rm.GetString("Awdk", ci)
'TDGrvTitle.InnerText = rm.GetString("GrvTitle", ci)
GVawdview.Columns(1).HeaderText = rm.GetString("AwdNam", ci)
GVawdview.Columns(2).HeaderText = rm.GetString("Awdesc", ci)
GVawdview.Columns(3).HeaderText = rm.GetString("Frequcy", ci)
GVawdview.Columns(4).HeaderText = rm.GetString("Active", ci)
End Sub
Protected Sub lnkEng2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles lnkEng2.Click
Thread.CurrentThread.CurrentCulture = New CultureInfo("en-US")
LoadStrings(Thread.CurrentThread.CurrentCulture)
gridbind()
End Sub
Protected Sub LnkEng1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles LnkEng1.Click
Thread.CurrentThread.CurrentCulture = New CultureInfo("es-ES")
LoadStrings(Thread.CurrentThread.CurrentCulture)
gridbind()
End Sub
|
|
|
|
|
Follow the step:
1) Create a base class
- Create a method called Translate(Page controls)
2) Inherit the base with all web pages and in page code behind call method Translate from the base class and pass the Control collection of page.
3) and In Translate method check control tye (may be label) then get the value of resource file same set as label id as per display the data.
modify the below code for support all supported languages -
string lan=Get from the Cookies or Session variab
Thread.CurrentThread.CurrentCulture = New CultureInfo(lan)
|
|
|
|