Is Instabang Worth Your Time and Money?

Instabang is a hookup site for those looking for casual hookups and no-strings-attached encounters. With over 2 million adults worldwide, this site has x-rated photos, advanced search filters and live streaming. But is it worth your time and money? Read on to find out what is Instabang, its features and user reviews to help you decide.

Facts

  • Similar to Instafuck Instabang is for adults looking for casual, no-strings-attached encounters with features like the ‘Who’s Cute’ game, swipe mechanics and live streaming for premium members.
  • The sign up process is quick and easy but has issues with fake profiles, unauthorized charges and strict account verification.
  • Instabang has an active community but be aware of billing practices and scams; compare with Fling for a more diverse dating experience.

What is Instabang

Instabang stands out from the rest with:

  • Over 2 million adults worldwide looking for hookups and casual encounters
  • Casual personals and spicy hookups
  • Big numbers and popular in the online dating scene

At first glance Instabang seems to have it all. X-rated photos, advanced search filters, everything you need to find your match for the night. And for those willing to take the plunge, premium membership options have even more to offer. But as we all know, looks can be deceiving in online dating.

We’re going to test Instabang’s big claims.

Instabang’s USP

In the dating site world, differentiation is everything. Instabang gets it, with a range of unique features to set itself apart. One of them is the ‘Who’s Cute’ game. This interactive feature allows you to be the matchmaker, voting on other members’ attractiveness. It’s like being a judge in your own beauty pageant – without the swimsuit competition!

If you love the swipe mechanics of apps like Tinder, don’t worry! Instabang has got you covered with its own swipe game, available to premium members only. This familiar yet fun feature will make the matching process more fun and, dare we say, instinctive.

The fun continues as Instabang takes it to the next level with live streaming. Imagine having front row seats to live shows of men, women and couples from the comfort of your own home. Instabang offers this to premium members and basic and premium live cam features.

And for those who want a more personal touch, the Premium Content option allows members to upload and view homemade photos by spending credits. It’s like having your own adult content network in your pocket!

Instabang Target Market

Instabang is clear about its target market. This is a site for liberated, passionate people looking for no-strings-attached encounters. If you’re looking for long term love or a soulmate to grow old with, you might want to swipe left on this one. Instabang is all about the physical side of relationships, for those looking for sexual gratification and hookups.

Breaking it down further, Instabang’s user base is 23-36 years old. There’s a big gender imbalance on the site, with 77% men and 23% women. That might be a bit strange, but it’s also less competition for the ladies looking for fun.

Whatever the ratio, one thing is for sure: Instabang is a playground for young adults who are ready to play and not afraid to ask for casual sex.

How to Join Instabang

Ready to get into the Instabang world? The sign up process is quick and easy, getting you one step closer to those hot encounters. To get started, you’ll need to choose your gender and the gender you’re looking for. It’s like filling out a naughty wishlist!

As you go through the sign up process, be prepared to provide some basic info. You’ll need to enter:

  • Your city and zip code, so Instabang can connect you with local hotties
  • Your age – remember, honesty is the best policy, even in the world of casual hookups
  • A valid email address for verification. This helps keep the site secure and ensures you’re a real person and not some sneaky bot.

Once you’ve done that, it’s time for the fun part – choosing your profile pics. Pick the ones that show off your best features and get ready to connect!

Initial Account Setup

After sign up, you’ll find that Instabang’s initial account setup is all about ease of use. The site is quick and simple to set up, you’ll be browsing profiles and chatting in minutes. But here’s a pro tip: choose your username wisely. Unlike other parts of your profile, your username is set in stone once registered. So, make sure it’s something you’re happy with long term – maybe leave the “SexyBeast69” for another day, eh?

User Interface

In the world of online hookups, a smooth and user friendly interface can be a big plus. Luckily, Instabang seems to have got the message. The site has a clean and simple design that’s easy to navigate, even for non techy people. The layout is well thought out, features are neatly categorised so you can find what you need in seconds. Whether you want to send a flirtatious message or browse through matches, it’s all just a click away.

One of the best things about Instabang’s design is the mobile responsiveness. In this day and age we’re always on the go, having a dating site that works on your phone is key. Instabang delivers on this front, the site is fully mobile and responsive across all screen sizes. So whether you’re swiping during your lunch break or chatting in bed at 2am, you’ll have a smooth experience. Check out our instabang review for more.

Instabang is browser compatible, but for the best experience you might want to use Google Chrome or Safari. The interface is designed to get you to the good stuff – messaging and profile browsing – as quickly as possible so you spend less time navigating and more time connecting. And let’s not forget about looks – Instabang’s simple design keeps it classy so your profile is the focus. After all, that’s what we’re all here for?

Features and Tools

Instabang has loads of features to help with your online dating. Let’s start with the ‘Trending Now’ page – think of it as your personal hot spot for all the latest activity on the site. This live feed shows status updates and posts from members so you can see what’s happening in the Instabang community right now. It’s like having your finger on the pulse of desire!

When searching for your match, Instabang has extensive search filters to help you narrow down your hunt for that perfect hookup. These filters include:

  • Kinks
  • Age range
  • Location
  • Looks
  • Interests
  • Hobbies
  • Lifestyle

It’s like having a personal matchmaker in your pocket!

Once you’ve found some profiles you like, Instabang has several ways to get in touch. You can send winks to show interest, swipe on photos or add profiles to your Favourites. These interactive tools let you show your hand without having to write the perfect opener. And for those who love the Instagram style, Instabang has features to let users share posts and engage with content in a social media like way.

Navigation is easy with the top bar which gives you quick access to the main sections of the site. Whether you want to:

  • search for new matches
  • see who’s online now
  • get into video chat
  • browse galleries
  • explore webcams

It’s all just a click away. This simple layout means you spend less time digging through menus and more time connecting with potential partners.

Premium Membership Benefits

While free members get a taste of the features, the magic happens when you upgrade to a Gold Membership. As a premium member you’ll get access to a whole heap of benefits that will increase your chances of finding that perfect casual hookup. Imagine being able to see who’s been looking at your profile – talk about a confidence boost! You’ll also be able to send unlimited messages so free members can chat up as many matches as they like with a free membership.

But that’s not all. Gold Members get access to premium content including those live streams we mentioned earlier. You’ll also be able to see who’s been liking and winking at you so you can see who’s most interested. And here’s the clincher – Instabang offer a 3 month money back guarantee for users who don’t find matches within the first 3 months. They’re so confident in their site they even offer a free 3 month membership if you don’t find a casual hookup within the first 3 months of a 6 or 12 month premium membership. With subscription options from:

  • 2 day trials
  • monthly plans
  • 6 month premium membership
  • 12 month premium membership

There’s a premium package to suit every budget and commitment level.

Real User Experience

Now let’s get into the nitty gritty – how does it actually feel to use Instabang? Many users say the site has a super active community that’s super open about casual sex. This honesty can be a big breath of fresh air if you’re sick of beating around the bush on other dating sites. The high user activity means you’re more likely to find someone who’s on the same page as you when it comes to no strings attached fun.

But it’s not all plain sailing on Instabang. Some users have reported hitting a few bumps in the road. For example one user signed up for a 3 day trial and was told they’d reached their “max number of messages” after sending just two. While this could be a way to prevent spam, it’s frustrating for genuine users trying to connect and read messages. As with any online site, you need to approach Instabang with a healthy dose of skepticism and be aware of the limitations especially if you’re a free or trial member.

Problems and Issues

Despite the great connections on Instabang, we need to acknowledge the common problems and challenges reported by users, including the negative reviews. One of the biggest issues is scams on the site, fake profiles. Some users have been scammed, one lost $600 to profiles asking for gas money and babysitter funds. A big reminder to always be careful when interacting with strangers online especially when money is involved.

Another problem that’s affected some Instabang users is unauthorized charges. There have been reports of aggressive auto billing that’s hard to cancel. Some users have been charged even after cancelling within the 24 hour trial period. The site has been accused of selling a cheap membership (£2.95) and then charging for a full month and then additional charges at the end of the month. This has left many users feeling ripped off.

Account closure is another problem some Instabang users have faced. One user had their account deactivated because the name on their credit card didn’t match the name on their profile. The company refused to reactivate the account and assumed the user was lying about their identity. A big ouch. This shows the importance of consistency in personal info across the site and payment methods but also raises questions about Instabang’s customer service and flexibility in resolving these kinds of issues.

Safety and Security

Despite the above mentioned issues, Instabang has many safety and security measures in place. One of the main defenses against fake accounts is the site’s email verification process. This step confirms user’s authenticity and ensures profiles are real and active. Instabang also takes a proactive approach by suspending profiles that are suspected to be fake.

To add to user trust Instabang has:

  • Genuine profiles with real photos
  • ‘Verified’ badge to show a user’s identity has been confirmed
  • Encryption for chat security so your conversations are private
  • Active fraud team working 24/7 to keep users safe and respond to any issues that may arise.

For users who want a more private experience Instabang allows you to set your profile to private so only friends can see you. There’s also a ‘safe mode’ for those who find explicit content uncomfortable. With Instabang’s compliance with regulations and huge user base it’s a safer space for users looking for casual encounters.

Overall Value and Alternatives

To determine Instabang’s overall value we need to compare it with other casual dating sites. One of the main competitors is Fling which has more features and bigger user base. While both sites are for casual encounters Fling seems to offer more variety in dating experience and might be a better value for users looking for more in their online dating adventures.

To really know if Instabang is worth your time and money you need to compare it with Fling. Instabang has some unique features like ‘Who’s Cute’ game and live streams but the billing and account issues might give some users pause. Ultimately the value of Instabang will depend on your personal preferences, budget and how much you’re willing to go through the challenges to get casual connections.

Recommendations and Conclusion

After trying out Instabang it’s clear this site could be good for those looking for discreet casual encounters. The site is a safe space for its users with many measures in place to keep your info and conversations private. The ‘Who’s Cute’ game, extensive search filters and live streams are great ways to connect with potential partners and spice up your online dating life.

But do approach Instabang with caution. The billing and account issues are a concern and should be considered before you sign up for a paid membership. If you’re willing to go through the challenges and looking for no strings attached connections Instabang might be worth trying out.

Just remember to be safe, keep your info private and always trust your gut when interacting with others online. Happy dating and may your casual encounters be safe, consensual and fun!

Conclusion

In the world of online dating Instabang finds its place as a casual encounters site. With its unique features, active community and focus on user safety it’s an interesting option for those looking for short term connections. But the road to digital desire isn’t smooth – from scams to billing issues users need to be careful. As we wrap up our review of Instabang remember the online dating world is big and diverse. Whether Instabang is your thing or not there’s a site out there for everyone. So go out there, explore and may your online dating journey be as exciting as it is safe. After all in the grand scheme of human connection even casual encounters can create unforgettable stories.

FAQs

Is Instabang safe?

Yes Instabang is safe as it has email verification and profile suspension for suspicious activities. But still be careful when interacting with others online. Be safe!

What are the features of Instabang?

Instabang’s features are the ‘Who’s Cute’ game, search filters, live streams and swipe based matchmaking for premium users. You can also use winks and favorites to show interest in others. Get ready to have fun!

How much does Instabang cost?

Instabang has different premium membership options with different prices including 2 day trials and annual plans. For the exact pricing check the site!

Can I use Instabang on my mobile?

Yes you can use Instabang on your mobile! The site is fully mobile responsive so you can use all its features on the go.

Are there any issues with Instabang I should be aware of?

Yes there have been some issues with Instabang including unauthorized charges and difficulty in canceling subscriptions. Read the terms of service and be careful when sharing payment info or interacting with others.

Is Chicktok Really Better Than Asstok? We tried it to find out.

If you’ve been keeping up on the world of local nudes and chat apps, then you’ve probably heard of Asstok. This app is a hookup app at its core, but it’s doing things in a different way than apps like Tinder. However, there’s a new app that may even be better called Chicktok.

Chicktok isn’t just a simple Asstok clone, however. You can read more about their Asstok features at https://chicktok.app/asstok-alternative/. It does what TikTok does but for adult content, and more. We tried it out to see if it’s really all it’s cracked up to be. Here’s our review!

An AssTok Alternative

The first thing we noticed was that the design is pretty similar to Tinder or other popular dating apps. But this one has some added features. It’s also an adult version of TikTok, just like Asstok. You can post videos on here, as well, complete with TikTok style filters.

There are three main tabs for video content: My Videos, Popular, and Trending. The design feels very much like other apps, actually, so it was easy to get used to navigating around.

TikTok Style Adult Videos

The videos are a little bit different than what you might normally see on a regular dating app. They have a TikTok style to them. Instead of just uploading pictures, users can upload short videos. These are usually about 30 seconds long. People can put these videos anywhere on their profile, whether it’s in the gallery or under a section called ‘My Videos.’

You can also search for other members by keyword, location, and more. You can sort through the results based on their video length, popularity, or name. When you click on someone’s profile, they’ll show you their name, age, gender, and some other details.

Tinder-Like Features

One of the best things about Asstok is how easy it is to use. If you’re familiar with Tinder, then it should feel natural to use. You swipe right or left based on your preferences. And you can add people to your favorites list. You can also look at their profiles to see what they have to say before making a decision.

What makes Chicktok better?

One of the best things about Chicktok is how well-organized it is. When you look at the different profiles, you get a list of all the people you’re connected to. If you want to go into a private conversation with someone, it’s right there in front of you.

Another cool feature is that you can choose whether to reveal your name or not. This means that you can have an anonymous hookup if you want to. And you can block people as easily as unblocking them, which is perfect for anyone who doesn’t want to deal with a lot of drama.

As far as features are concerned, you can send virtual gifts through the app. This includes stickers, sounds, and photos. There’s also a video chat option available, so you don’t even need to leave your house to meet up with someone.

There’s also a “chatter” section where you can post statuses, videos, memes, pics, and more. This is a fun addition to the app that helps give it personality, and it’s totally optional too.

Does it really work?

It definitely works. We downloaded the app and tried out the features. Within a few minutes, we had already found several matches. After chatting with a couple of these girls, we realized that this app was legit. These were real women who wanted a little something extra in their lives.

Our favorite part about Chicktok is how easy it is to use. There are plenty of pictures and videos, as well as video clips, so you can get a good idea of what each person looks like before you make contact. The messaging system works just like any other chat app, and the profiles are very detailed.

We made a profile, set our preferences, and started swiping away. In less than 10 minutes, we had a bunch of matches. Each girl was super cute and friendly, and most of them seemed pretty down to earth.

Some of the girls wanted casual sex, and others weren’t interested in anything serious. It was up to us to decide whether or not to continue talking. But either way, it was a great experience.

Conclusion: Is Chicktok really better than Asstok?

It looks like it is! With a clean interface, easy browsing options, and tons of ways to connect with others, Chicktok definitely seems like a good choice. You might even say it’s a better alternative to Asstok.

Is there a TikTok for adults?

Is there an adult TikTok Version? Yes, there is an adult Tiktok version called AssTok.

AssTok is a new local sex app and TikTok-like web app that lets you browse through adult videos and swipe on the ones you want to watch. AssTok lets you swipe up to look at previews of popular videos, and then swipe left to watch them – in portrait or landscape mode. The app is inspired by TikTok’s video discovery experience, but its content is accessible through a mobile browser – not a standalone app. Google Play and Apple App Store have strict policies against pornographic content, and they simply wouldn’t allow an app serving such content.

Adults can download and use the standard TikTok app to watch and share videos. Adults can choose who to follow and whether or not to engage with trends. There isn’t a specific version of TikTok intended for adults. All TikTok users must follow the Community Guidelines, which includes a ban on explicit content. Not following the guidelines could result in a shadowban, or worse, a full account ban. If you’re just planning to use the app for your own amusement or to keep in touch with friends and family, you don’t need to worry about that.

YouPorn has created a new adult TikTok app that lets you scroll through previews of porn videos. If you swipe up, you’ll move to the next preview. The app will also try to guess your preferences, and suggest others videos you may like. The website doesn’t have a standalone app on Google Play or Apple’s App Store due to its strict anti-porn policies. Despite being a web app, you can still create an app icon for the service on your phone’s home screen.

Just Where Is WebResource.axd?

I stumbled upon and answered a question at Stackoverflow this morning – Where is WebResource.axd? – and thought it might be worth to elaborate a bit on the question and answer here, on my blog.

But first, imagine you are developing a Web control or a library or a framework that requires certain external resources, such as images, JavaScript, and CSS.

When developing your control/library/framework you may have such external content sitting in a particular folder in your application, but when you get ready to package your control/library/framework you want the end product to be a single assembly (that is, a single DLL file), and not an assembly plus a folder for images and a folder for JavaScript files and a folder for CSS files.

In other words, you do not want to require that your users – other web developers – have to add a bunch of folders and images/JavaScript/CSS files to their website to start using your control/library/product; rather, you want everything to work once the developer drops your assembly into their Bin folder.

Such functionality is possible by using embedding resources. An embedded resource is a resource file – like an image, JavaScript, or CSS file – that is embedded within the compiled assembly.

This allows a control/library/framework developer to embed any external resources into the assembly, thereby having the entire application existing in one single file. Consider ASP.NET’s validation controls.

These controls require that certain JavaScript functions be present in order for them to use client-side validation. When using the validation controls you don’t need to add any JavaScript files to your website; instead, the JavaScript used by these controls is embedded in one of the built-in ASP.NET assemblies.

But if the external resources are embedded in the assembly, how do you get it out of the assembly and onto a web page?

The answer is WebResource.axdWebResource.axd is an HTTP Handler that is part of the .NET Framework that does one thing and one thing only – it is tasked with getting an embedded resource out of a DLL and returning its content.

What DLL to go to and what embedded resources to take is specified through the querystring. For instance, a request to www.yoursite.com/WebResource.axd?d=EqSMS…&t=63421… might return a particular snippet of JavaScript embedded in a particular assembly.

The d querystring parameter contains encrypted information that specifies the assembly and resource to return; the t querystring parameter is a timestamp and is used to only allow requests to that resource using that URL for a certain window of time.

To see WebResource.axd in action, create an ASP.NET Web page that includes some validation controls, visit the page in a browser, and then do a View/Source. You will see a number of <script> tags pulling in JavaScript from WebResource.axd like so:

1<script src="/YourSite/WebResource.axd?d=fs7zUa...&amp;t=6342..." type="text/javascript"></script>
2 
3<script src="/YourSite/WebResource.axd?d=EqSMSn...&amp;t=6342..." type="text/javascript"></script>

Here, WebResource.axd is pulling out embedded JavaScript from an assembly and returning that JavaScript to the browser. If you plug in those URLs into your browser’s Address bar you’ll see the precise JavaScript returned.

Ok, so now that we know what WebResource.axd is and what it does the next question is, where is it? Clearly, there’s no file named WebResource.axd in your website – what’s going on here? Here’s my answer from the Stackoverflow question:

.axd files are typically implemented as HTTP Handlers. They don’t exist as an ASP.NET web page, but rather as a class that implements the IHttpHandler interface. If you look in the root Web.config (%WINDIR%\Microsoft.NET\Framework\version\Config\Web.config) you’ll find the following entry:

1<add path="WebResource.axd"
2verb="GET"
3type="System.Web.Handlers.AssemblyResourceLoader"
4validate="True" />

This entry says, “Hey, if a request comes in for WebResource.axd then use the HTTP Handler AssemblyResourceLoader in the System.Web.Handlers namespace.

The code for this class is a bit lengthy, so I can’t post it here, but you can use a disassembler like the free Reflector to view this class’s source code. You could probably get the original source code (with comments) by using the NetMassDownloader tool.

So there you have it. WebResource.axd is an HTTP Handler built into the .NET Framework that retrieves embedded resources from assemblies.

To learn more about WebResource.axd and how to go about embedding resources in an assembly, refer to my article, Accessing Embedded Resources through a URL using WebResource.axd.

Happy Programming!

Returning Dynamic Types from an Ajax Web Service Using C# 4.0

Over at 4Guys, I’m authoring a series of articles showing different techniques for accessing server-side data from client script.

The most recent installment (Part 2) shows how to provide server-side data through the use of an Ajax Web Service and how to consume that data using either a proxy class created by the ASP.NET Ajax Library or by communicating with the Ajax Web Service directly using jQuery.

When returning data from a service it’s not uncommon to create a specialized Data Transfer Object (or DTO), and in Part 2 I create two such DTO classes. Here’s the basic design pattern:

  1. Create a DTO class that has properties that model the data you wan to return. For instance, the following DTO class can be used to transmit CategoryIDCategoryName, and Description information about one or more categories.
  2. In the service, get the data of interest from your object layer. In the demo for this article series I use Linq-To-Sql as my data access layer and object model. Here is code from the Ajax Web Service’s GetCategories method that retrieves information about the categories in the system:
  3. Now the results need to be mapped from the domain object to the DTO. This can be done manually or by using a library like AutoMapper. In the above example, we would iterate through the results to create an array of CategoryDTO objects, which is what would be returned.

If you are using C# 4.0 you can choose to live in a looser-typed world. Rather than having the Ajax Web Service return a strongly-typed value (namely, an array of CategoryDTO objects) you could instead opt to have a more ethereal return type – dynamic!

Having a return type of dynamic allows you to return an anonymous type, meaning you don’t need to create a DTO nor do you need to map the domain object to the DTO. Instead, you’d just create an anonymous type, like so:

Note the dynamic keyword as the method’s return type. Also note that results is a query that returns an enumeration of anonymous types, each of which has three properties – CategoryIDCategoryName, and Description.

The call to the ToArray method executes the query and returns the array of anonymous types as the method’s output.

Because the anonymous type’s properties. The client-side script calling this method can work with the returned anonymous type using the exact same code as with the strongly-typed return type.

Control Building and ViewState Lesson for the Day

Whenever I am working on a problem and hit a perplexing roadblock that impedes my process, my initial emotional state is calm. “I’ll figure out this problem soon,” I tell myself, as I explore workarounds or examine the code base to try to understand why I can’t do what I know I should be able to do.

If this search goes on for five or more minutes, I start to get a little flustered. Off to Google!” I declare, hoping there has been some other unfortunate soul who has experienced the same problem and has shared his solution.

I usually hit the Google Web search first and, if I have no luck there, I delve into the USENET postings on Google Groups. If 15 minutes have passed with no hits from Google, I start to get angry at myself. “I SHOULD KNOW HOW TO FIX THIS,” I say, as I pour back over the material I examined in the first five minutes, knowing there must be something I overlooked.

What’s interesting is that if this search continues into, say, the half-hour mark, my emotions start to sway from frustration and despair to glee. “Wait until I figure out what went wrong,” I reason, “and I can share it on my blog, and it will help others down the road.” And that’s what keeps me going.

Today’s lesson – which will hopefully save you the 40 minutes it cost me – centers around composite controls, the DropDownList Web control, and ViewState.

Let’s say you want to create a composite control that contains a DropDownList that already is bound to database data (namely, it does not allow the control developer to specify the DropDownList’s DataSource as would normally be the case: for a discussion on the pros and cons of this approach check out Composite Controls That Do Their Own DataBinding by Andy Smith).

If you are at all like me, your composite control’s code would look like this (WARNING: this is wrong):

This, as aforementioned is the WRONG WAY to do it. Why? Well, give the control a whirl by creating an ASP.NET Web page with this control and a Button Web control.

When you visit the page the first time, the DropDownList is displayed, populated with the database data. However, if you click the button and the page posts back, the items in the DropDownList disappear – the DropDownList is not saving its view state.

If you’re like me, the first thing you do is crack open Developing Microsoft ASP.NET Server Controls and Components, thumb through to Chapter 12: Composite Controls, and read the section titled “State and Child Controls.”

The gist of the section says that composite controls don’t need to employ extra effort to save the view state of their children since it’s saved automatically when the page recursively walks the control tree to generate the entire view state.

Opening Reflector, I poured through the Page and Control classes and saw that, yes, the control hierarchy should be walked and the view state saved, so when my composite control’s SaveViewState() method was called, it should save not only its own view state but the view state of its child(ren): namely, the DropDownList. But, evidently, it was not.

This got me to scratching my head. Why isn’t the DropDownList’s view state being saved? EnableViewState for both the Web page, composite control, and DropDownList were all set to True (the default). I looked at the SaveViewState() method for the DropDownList and confirmed that it should be saving its view state. So why wouldn’t the DropDownList be saving its view state?

And then it occurred to me – check to make sure that the DropDownList’s IsTrackingViewState property is True – if it isn’t, then the DropDownList won’t be recording changes to its state, and therefore won’t produce a ViewState.

A control begins tracking its view state when its TrackViewState() method is called, and this is handled after the Initialization stage of the page lifecycle. So, if the DropDownList is being added after that stage, then it wouldn’t be tracking its view state, and therefore its state would be lost on postbacks.

But wait a minute, if you add a child control via the Controls.Add() method, the added child control’s TrackViewState() method is automatically called. But wait! Only those items added to the view state after the view state has started being tracked will be recorded.

So binding the items to the DropDownList prior to adding the DropDownList to the Controls collection causes those additions to not be saved in the view state for the DropDownList.

Rather, we need to first add the DropDownList to the Controls collection and then bind the database data to the list. The order matters because we don’t want to bind the data to the DropDownList until after we’ve started tracking view state.

Determining an ASP.NET Page’s View State Footprint

ASP.NET view state is the technique used by an ASP.NET Web page to persist changes to the state of a Web Form across postbacks.

The view state of a page is, by default, placed in a hidden form field named __VIEWSTATE, and can easily get very large.

Not only does the __VIEWSTATE form field cause slower downloads, but, whenever the user posts back the Web page, the contents of this hidden form field must be posted back in the HTTP request, thereby lengthening the request time, as well.

Because view state is buried in a hidden form field and because as a developer we typically test locally, the effect of view state bloat on the user experience requires preemptive action. Steps must be taken to measure the view state’s size and to take steps in trimming down view state if it begins to negatively affect the user experience.

There are a variety of techniques for measuring the view state size on a given page. Perhaps the simplest is to turn on page tracing.

With page tracing enabled you can see the estimated view state of each control in the control hierarchy. For instance, the screen show below shows that two Labels on my page consume (roughly) 120 bytes of view state each.

There’s also a free add-on for Firefox that reports view state size directly in your browser window: Viewstate Size. When installed, this add-on will show a little icon in your browser’s lower right corner reporting the view state size for a given page.

It’s also possible to determine the view state size programmatically. Today I was working on a demo for an article and wanted to have the view state size displayed on every page.

After reading an article I wrote back in 2004 – Understanding ASP.NET View State – I came up with the following code snippet to compute and display the view state size for a given page.

This technique uses the “old school” way of doing it, relying on objects that have been around since ASP.NET’s inception. Consequently, the below code will work in any ASP.NET application.

The approach overrides the SavePageStateToPersistenceMedium method, which is what is invoked when the page is ready to persist its view state.

In ASP.NET 1.x you would override this method to store view state to an alternative store, such as to a file on the web server, rather than in a hidden input field on the form. Starting with ASP.NET 2.0 you could use the PageStatePersister class.

However, here I just want to compute the size of the serialized view state string. Consequently, I start by calling the base class’s SavePageStateToPersistenceMedium method.

Next, I replicate the default logic that the ASP.NET Page class uses to serialize view state – namely, I create a LosFormatter object and serialize the content to a StringWriter.

Once I’ve done this I can determine the size of the persisted view state by getting the StringWriter‘s contents and determining how many characters are included.

The above code can be placed directly in a code-behind class or, better yet, in a custom base Page class.

The above programmatic approach is relatively easy to implement and works in all versions of ASP.NET. However, it won’t produce the precise view state size for ASP.NET 2.0 applications and beyond.

This is because the LosFormatter class was replaced with a new formatting type, ObjectStateFormatter, starting in ASP.NET 2.0. (You can certainly use the LosFormatter code above in ASP.NET 2.0 and beyond applications, as the class remains in the framework for backwards compatibility.

Granted, the reported view state size and actual size will differ slightly, but in analyzing whether a page contains too much view state or not, precise numbers aren’t required – a close estimate will usually suffice.)

To get precise measurements we can use the ASP.NET 2.0+ by doing the following:

  1. Create a class that extends the HiddenFieldPageStatePersister class. This is the class that is used by ASP.NET (by default) to persist view state and other information to hidden form fields. We want to extend this class to include a property that reports the size of the persisted state, and
  2. Override the Page class’s PageStatePersister property and return the custom persister class created in step 1.
  3. Override the Page class’s SavePageStateToPersistenceMedium method and read the value of the view state size from the class created in step 1.

Here’s the code for the class that extends HiddenFieldPageStatePersister, which I’ve named MyHiddenFieldPageStatePersister (please don’t mock me for my lack of naming creativity).

This class is pretty simple: it defines a property named StateSize, overrides the Save method, and then sets the StateSize property from this method using the same code/logic as used internally by the HiddenFieldPageStatePersister class.

The code snippet below takes advantage of some language features that you might not have at your disposal if you’re using an older version of C# or VB (for example, the use of automatic properties).

Links to Scott Guthrie’s Using LINQ to SQL Tutorials

Back when Visual Studio 2008 came out, Scott Guthrie wrote an excellent series of blog posts on using LINQ to SQL.

Unfortunately, the various installments are not easy to follow when starting from Part 1 and going onward, so I’ve decided to gather and organize the links here for me and for anyone else interested in his tutorial.

Using LINQ to SQL

Also, there was (at one time) a single PDF containing all of these tutorials, but the website where it was hosted appears to be offline. Does anyone have a copy of that PDF they’d care to send me to host?

UPDATE: Some time ago a developer by the name of Kadir Pekel compiled all nine tutorials into a single PDF and hosted them on his website, http://it-box.blogturk.net, but that website no longer is around.

Helpful reader Milan had a copy of said PDF and sent it to me (thank you!), which you can download here, if interested: http://www.datawebcontrols.com/classes/LINQToSql.zip

Select a textbox’s text on focus using jQuery

A fellow ASP.NET developer asked me today how he could have the text in a TextBox control automatically selected whenever the TextBox received focus.

In short, whenever any textbox on the page receives focus you want to call its select() function. (The JavaScript select() function is the function that actually selects the textbox’s text if any.) Implementing this functionality requires just one line of JavaScript code, thanks to jQuery:

1$("input[type=text]").focus(function() { $(this).select(); });

In English, the above line of code says, “For any <input> element with a type=”text” attribute, whenever it is focused call it’s select() function.”

If you only wanted certain textboxes on the page to auto-select their text on focus you’d update the selector syntax accordingly. For example, the following modification only auto-selects the text for those textboxes that use a CSS class named autoselect:

1$("input[type=text].autoselect").focus(function() { $(this).select(); });

That’s all there is to it! You can view the complete script and try a working demo at http://jsfiddle.net/ScottOnWriting/Kq7A4/2/

One final comment: if one or more of the textboxes you want to auto-select exist within an UpdatePanel control then consider using jQuery’s live() function. The live() function maintains the event bindings even when the HTML is regenerated due to a partial page postback; for more information, see my article – Rebinding Client-Side Events After a Partial Page Postback. For more information on jQuery, see Using jQuery with ASP.NET.

EDIT [2011-03-29]: To get this to work in Safari / Chrome you will need to add a mouseup event handler and disable the default event, as the onmouseup event is causing the textbox to be unselected. For more details, see this Stackoverflow post: Selecting text on focus using jQuery not working in Safari and Chrome.

$(“input[type=text].autoselect”).focus(
function() {
$(this).select();
}
)
.mouseup(
function(e) {
e.preventDefault();
}
);

Can Music Affect Your Romantic Relationships?

In the past, live performers used to play pieces entitled ‘ode to joy’ or, ‘ode to sadness.’

These pieces of symphonic music induced real emotions amongst listeners. The rooms used to be full of visible emotions such as courtship, anger, melancholy, etc.

However, music’s changed now. Musical clips can’t surely impact us or our relationships, right?

Wrong!

Our body and our minds respond to tempo, rhythmic changes, lyrical interpretations, and everything else we find in both modern and classical music.

Here’s how music affects us and our relationships –

The Single Phase

Long before you’re even in a relationship, your music taste can impact your chances of attracting members of the opposite sex. For instance, sexually aggressive songs, can make men feel misogynistic. Similarly, men-hating songs induce negative thoughts in female brains, especially the way they view the men in their lives.

Creating Memories

Quite possibly one of the first dates or meetings you share with your partner will be marked with a soundtrack.

Rare moments of intimacy (e.g., the first flirtation or the first kiss) are registered in special regions of our brains.

These memories become ostensibly linked to whatever music we were listening to during that time.

That’s why many people have certain soundtracks or songs that remind them of the ‘happiest days.’

Sharing common interests like music is important to many couples, and that’s why many dating apps take musical tastes into account for their matchmaking algorithms. If music is particularly important to you, this site can help you find a dating site to match you with like minded people.

Music Impacts How You Appreciate Your Loved Ones

In a recent study, it was proven that music impacted the way men bought gifts for women. The experiment involved romantic music being played in a small flower shop. Romantic music made men buy more flowers! Similarly, any media with amorous content has been proven to enhance romantic thoughts. These effects are shared by both sexes. However, these music-driven effects aren’t always positive. For instance, people listening to antisocial music often demonstrate symptoms of psychopathy.

Sexual Attraction

Our brains release dopamine whenever we listen to a favorite piece of music. A similar amount of dopamine is released during lovemaking. Hence, music has always been linked with sexual attraction. It is not uncommon for couples to have their ‘special song.’

Family Time

Music can impact your family life. When groups of people play music, they experience ‘group think’ or ‘synchronization.’ For instance, two members of the family may start dancing together automatically when they listen to tunes.

Boost Inter-Relationship Empathy

Music also evokes empathy. People are more likely to feel empathic responses towards their designated ‘music listening partners.’ Hence, when couples who’ve shared ‘listening experiences’ break up, they have to stop listening to their once favorite tracks. Researchers have also stated that children who share musical experiences with their parents are more likely to have mature and empathetic familial relationships when they grow up. 

Taking the Edge Off

Too much time spent with the family can be stressful as well. The best solution for mom and dad looking for some free time? Music! The relaxing effects of music are well-documented. Music loving couples know how to uncomplicate personal debates and take the edge off.

Get You Through the Hard Times

Every relationship has its own share of struggles. When loud fights, arguments, or painkillers don’t do the job – your favorite song might be the best solution.

When people listen to music they love, their tolerance levels and emotional maturity improve.

They’re able to control their anxiety, look past the distractions triggered by the argument, and show empathy.

Health

Couples who indulge in workout together stay healthy and happy. Adding music to this dynamics only improves matters. Put on some energetic music (that you both like) and start strengthening your bodies and your love for each other!

Music and relationships are two of nature’s greatest gifts. No wonder they complement each other so well!